Advertisement
Guest User

Untitled

a guest
Apr 9th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1.                 public Connection getDbConnection() throws SQLException
  2.     {
  3.         // Read RDS connection information
  4.         // TODO: Move this to a properties file
  5.  
  6.         String dbName = "BigVisionGames";
  7.         String userName = "";
  8.         String password = "";
  9.         String hostname = "eu-west-2.rds.amazonaws.com";
  10.         String port = "3306";
  11.         String jdbcUrl = "jdbc:mysql://" + hostname + ":"
  12.                 + port + "/" + dbName + "?user=" + userName + "&password=" + password;
  13.        
  14.         System.out.println("DB Connection opened");
  15.        
  16.         return DriverManager.getConnection(jdbcUrl);
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement