Guest User

Untitled

a guest
Feb 11th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1.     Connection con;
  2.     Statement stm;
  3.     ResultSet rs;
  4.  
  5.     {
  6. try {
  7.   Class.forName("org.gjt.mm.mysql.Driver");
  8.  
  9.   con = DriverManager.getConnection
  10.        ("jdbc:mysql://localhost/basededatos", "root", "");
  11.     System.out.println("Conexión completa.");
  12.  
  13.   stm = con.createStatement();
  14.  
  15.   // rs = stm.executeQuery("SELECT * FROM alumnos");
  16.  
  17.   con.close();
  18.  
  19. } catch (Exception e){
  20.     System.out.println("Error: " + e.getMessage());
  21. }
  22.  
  23. }
  24.     }
Add Comment
Please, Sign In to add comment