Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class MyDB {
- private static String
- schema = "yeet",
- user = "root",
- pass = "root",
- path = "jdbc:mysql://localhost:3306/"+schema;
- public Connection getCon()
- throws InstantiationException, IllegalAccessException,ClassNotFoundException, SQLException {
- Connection c;
- Class.forName("com.mysql.jdbc.Driver").newInstance();
- c = DriverManager.getConnection(path,user,pass);
- return c;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement