Advertisement
Guest User

Untitled

a guest
Mar 30th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1.  
  2. package Config;
  3.  
  4. import java.sql.*;
  5.  
  6. public class Conexion {
  7.     Connection con;
  8.     public Conexion(){
  9.         try {
  10.             Class.forName("com.mysql.jdbc.Driver");
  11.             con=DriverManager.getConnection("jdbc:mysql://localhost:3306/registro","root","***");            
  12.         } catch (Exception e) {
  13.             System.err.println("Error"+e);
  14.         }
  15.     }
  16.     public Connection getConnection(){
  17.         return con;
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement