Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- *
- * @author sohel1
- * @version 1.0
- * @since 1.0
- */
- public class DBUtility {
- // I haven't added documentation comment, pls add it.
- private final String URL;
- private final String USERNAME;
- private final String PASSWORD;
- public DBUtility(String URL, String USERNAME, String PASSWORD) {
- this.URL = URL;
- this.USERNAME = USERNAME;
- this.PASSWORD = PASSWORD;
- }
- public Connection getConnection() throws SQLException {
- Connection connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);
- return connection;
- }
- }
Add Comment
Please, Sign In to add comment