Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Connection getConnection() throws Exception {
- if(connection == null || connection.isClosed()) {
- Class.forName("com.mysql.jdbc.Driver");
- connection = (Connection) DriverManager.getConnection(
- "jdbc:mysql://" + host + ":" + port + "/" + database, username, password);
- }
- return connection;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement