Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Conectar;
- import java.sql.*;
- public class ConexionBD {
- Connection conectar=null;
- public Connection getConexionBD(){ //metodo
- try {
- Class.forName("com.mysql.jdbc.Driver");
- conectar=DriverManager.getConnection("jdbc:mysql://localhost/bdhospital","root","");
- } catch (Exception e) {
- System.out.println("No es posible conectar a la base de datos ");
- System.out.print(e.getMessage());
- }
- return conectar;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement