public final class DatabaseAdaptorPostgresql implements DatabaseAdaptor{
+ private static String url = "jdbc:postgresql://localhost:5432/mir";
+ private static String driver = "org.postgresql.Driver";
+
public String getDriver() {
- return MirConfig.getProp("Adaptor.PostgreSQL.Driver");
+ return driver;
}
public String getURL(String user, String pass, String host) {
- return MirConfig.getProp("Adaptor.PostgreSQL.URL");
+ return url;
+ }
+
+ public static void setUrl(String u) throws Exception {
+ if (!url.startsWith("jdbc:"))
+ throw new Exception("Database Adaptor URL must begin with: \"jdbc:\"");
+ url = u;
+ }
+
+ public static void setDriver(String d) {
+ driver = d;
}
public boolean hasLimit() {