Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Connection connect() {
- try {
- Class.forName(jdbcDriver);
- System.out.print("jdbc:mysql://" + host + "/" + database + " " + user + " " + password);
- connection = DriverManager.getConnection("jdbc:mysql://" + host + "/" + database, user, password);
- connected = true;
- return connection;
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- return null;
- } catch (SQLException e) {
- e.printStackTrace();
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement