Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Connection connection() throws IOException, SQLException {
- Properties properties = new Properties();
- InputStream inputStream = null;
- inputStream = new FileInputStream("connection.properties");
- properties.load(inputStream);
- String DB_URL= (String) properties.getProperty("DB_URL");
- String DB_USER= (String) properties.getProperty("DB_USER");
- String DB_PASS= (String) properties.getProperty("DB_PASS");
- Connection conn = DriverManager.getConnection(DB_URL, DB_USER, DB_PASS);
- return conn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement