- public Connection connect(String host, int port, String user, String pass) {
- // TODO Auto-generated method stub
- return null;
+ public Connection connect(String host, int port, String dbName, String user, String pass) throws SQLException {
+ String url = "jdbc:postgresql://" + host + ":" + port + "/" + dbName;
+ Properties props = new Properties();
+ props.setProperty("user", user);
+ props.setProperty("password", pass);
+ //props.setProperty("ssl", "true");
+ return DriverManager.getConnection(url, props);