Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class conexion {
- public String db ="Juntaagua";
- public String url="jdbc:mysql://127.0.0.1:8889/"+db;
- public String user="root";
- public String pass= "root";
- public int nombre = 1;
- public conexion() {
- }
- public Connection conectar(){
- Connection link = null;
- try {
- Class.forName("org.gjt.mm.mysql.Driver");
- link=DriverManager.getConnection(this.url, this.user, this.pass);
- } catch (ClassNotFoundException | SQLException e) {
- JOptionPane.showConfirmDialog(null, e);
- }
- return link;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement