Guest User

Untitled

a guest
Oct 5th, 2016
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public ProductRepositorySql() {
  2.         Properties properties = new Properties();
  3.         String url = "jdbc:postgresql://gegevensbanken.khleuven.be:51516/2TX33";
  4.         properties.setProperty("user", "r0623506");
  5.         properties.setProperty("password", "");
  6.         properties.setProperty("ssl", "true");
  7.         properties.setProperty("sslfactory", "org.postgresql.ssl.NonValidatingFactory");
  8.         Connection connection;
  9.         try {
  10.             Class.forName("org.postgresql.Driver");
  11.             connection = DriverManager.getConnection(url, properties);
  12.             statement = connection.createStatement();
  13.         } catch (SQLException e) {
  14.             throw new DbException(e.getMessage(), e);
  15.         } catch (ClassNotFoundException e) {
  16.             throw new DbException(e.getMessage(), e);
  17.         }
  18.     }
Add Comment
Please, Sign In to add comment