Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DatabaseControl {
- Connection conn;
- public DatabaseControl()
- {
- }
- public static Connection getConnection(String dbURL, String user, String password)
- throws SQLException, ClassNotFoundException {
- Class.forName("com.mysql.jdbc.Driver");
- return DriverManager.getConnection(dbURL, user, password);
- }
- public void open()
- {
- try
- {
- conn = getConnection("jdbc:mysql://sql.ewi.tudelft.nl/DataBaseNaam", "user", "password");
- }catch(Exception e)
- {
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement