Guest User

Untitled

a guest
Dec 2nd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. private Persistencia() {
  2. base = BaseDatos.getInstancia();
  3. base.conectar("jdbc:mysql://localhost/dda", "root", "1234");
  4. }
  5.  
  6.  
  7. public void conectar(String url,String u,String p){
  8. try {
  9. conexion = DriverManager.getConnection(url, u, p);
  10. stmt = conexion.createStatement();
  11. } catch (SQLException ex) {
  12. System.out.println("Error al conectar:" + ex.getMessage());
  13. }
  14. }
Add Comment
Please, Sign In to add comment