SHOW:
|
|
- or go back to the newest paste.
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", ""); |
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 | } |