Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Connection createConnection() throws ClassNotFoundException,
- SQLException {
- Class.forName("com.mysql.jdbc.Driver");
- connection = DriverManager.getConnection(
- "jdbc:mysql://localhost/festivaldatabase", "root", "abcd1234");
- log.info("----Connection established with MYSQL database----");
- return connection;
- }
- /**
- * <br/>
- * METHOD DESCRIPTION: <br/>
- * Close connection accessing the underlying database. <br/>
- *
- * @throws SQLException
- *
- */
- public static void closeConnection() throws SQLException {
- log.info("----Connection closed with MYSQL database----");
- connection.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement