Ok, big merge. here's the new xml-config stuff in action. There's a few
[mir.git] / source / mir / storage / DatabaseAdaptorPostgresql.java
index 9954a4b..39b2a57 100755 (executable)
@@ -12,12 +12,25 @@ import mir.misc.*;
 
 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() {