Conexion
Publicado por Pepe (1 intervención) el 17/05/2006 15:13:27
COmo puedo mejorar mi clase conexion.
public f c Conexion {
p static f String driverName = "";
p static f String dbName = "";
p static f String dbUser = "";
p static f String dbPass = "";
public st Connection obtenerConexion() throws SQLException{
Connection con = null;
try{
Class.forName(driverName).newInstance();
}catch(Exception ex){
}
try{
con = DriverManager.getConnection(dbName, dbUser, dbPass);
}catch(SQLException ex){
}
return con;
}
}
public f c Conexion {
p static f String driverName = "";
p static f String dbName = "";
p static f String dbUser = "";
p static f String dbPass = "";
public st Connection obtenerConexion() throws SQLException{
Connection con = null;
try{
Class.forName(driverName).newInstance();
}catch(Exception ex){
}
try{
con = DriverManager.getConnection(dbName, dbUser, dbPass);
}catch(SQLException ex){
}
return con;
}
}
Valora esta pregunta


0