Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Connection getConexion(){
- Connection con = null;
- try {
- Class.forName("com.mysql.jdbc.Driver");
- con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/baseDeDatos","root","clave");
- return con;
- } catch (Exception e) {
- //JOptionPane.showMessageDialog(null, "Error al conectarse con la BD: "+e.getMessage());
- }
- return con;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement