1 package net.jaekl.cfb.db.driver;
3 import java.sql.Connection;
4 import java.sql.DriverManager;
5 import java.sql.ResultSet;
6 import java.sql.SQLException;
7 import java.util.Properties;
9 import net.jaekl.cfb.db.Column;
10 import net.jaekl.cfb.db.Table;
12 public class PostgresqlDriver extends DbDriver {
15 public void load() throws ClassNotFoundException {
16 // This should no longer be necessary, so long as we're using
17 // JDBC 4 (which came out with JDK 6) and an updated driver.
18 // But, it shouldn't hurt, either.
19 Class.forName("org.postgresql.Driver");
23 public Connection connect(String host, int port, String dbName, String user, String pass) throws SQLException {
24 String url = "jdbc:postgresql://" + host + ":" + port + "/" + dbName;
25 Properties props = new Properties();
26 props.setProperty("user", user);
27 props.setProperty("password", pass);
28 //props.setProperty("ssl", "true");
29 return DriverManager.getConnection(url, props);
33 public ResultSet selectColumnsFromWhere(Column[] columns, Table[] tables, String where) {
34 // TODO Auto-generated method stub