Advertisement
Spartaner_v1

JDBC-Driver method

Mar 22nd, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1. public Connection openConnection() throws Exception {
  2.         Class.forName("com.mysql.jdbc.Driver");
  3.         Connection connection = DriverManager.getConnection("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database, this.user, this.password);
  4.         this.connection = connection;
  5.         return connection;
  6.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement