tapha2150309
Messages postés20Date d'inscriptionmercredi 23 mars 2011StatutMembreDernière intervention21 juillet 2013
-
8 mars 2013 à 21:34
cs_Julien39
Messages postés6414Date d'inscriptionmardi 8 mars 2005StatutModérateurDernière intervention29 juillet 2020
-
9 mars 2013 à 11:22
je travaillai avec sqlserver 2005 .avec la fiche de connexion DB ci apres qui marché tres bien alors je veu plus utiliser sqlserver mais plutot mysql .je veu concervé le DB svp k fau til modifier pour k sa marche avec mysql.mrci voici le DB:
import java.sql.*;
import java.util.ResourceBundle;
/**
*
* @author fama-fall
*/
public class DB {
private int nbligne=0;
private Connection cn=null;
private Statement stmt=null;
private PreparedStatement pstmt;
public DB(){
try
{
//InputStream ins = this.getClass().getResourceAsStream("/propriete/props.properties" );
ResourceBundle bdl = ResourceBundle.getBundle("propriete/props");
String driver=bdl.getString("driver");
String url=bdl.getString("url");
String user=bdl.getString("login");
String password=bdl.getString("password");
Class.forName(driver);
cn=DriverManager.getConnection(url,user,password);
// cn.setAutoCommit(false);
}
catch(Exception ex){
System.out.println(ex.getMessage());
}