Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Connection con;
- public static void connect() {
- if (!isConnected()) {
- try {
- con = DriverManager.getConnection("jdbc:mysql://localhost/mixedup?autoReconnect=true&useSSL=false", "root",
- "159753");
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- public static void disconnect() {
- if (isConnected()) {
- try {
- con.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- public static boolean isConnected() {
- return (con != null);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement