empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r817099 - in /incubator/empire-db/trunk/empire-db-codegen/src/main/java/org/apache/empire/db/codegen: CodeGen.java CodeGenConfig.java
Date Sun, 20 Sep 2009 20:47:59 GMT
Author: doebele
Date: Sun Sep 20 20:47:59 2009
New Revision: 817099

URL: http://svn.apache.org/viewvc?rev=817099&view=rev
Log:
EMPIREDB-52

Modified:
    incubator/empire-db/trunk/empire-db-codegen/src/main/java/org/apache/empire/db/codegen/CodeGen.java
    incubator/empire-db/trunk/empire-db-codegen/src/main/java/org/apache/empire/db/codegen/CodeGenConfig.java

Modified: incubator/empire-db/trunk/empire-db-codegen/src/main/java/org/apache/empire/db/codegen/CodeGen.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-codegen/src/main/java/org/apache/empire/db/codegen/CodeGen.java?rev=817099&r1=817098&r2=817099&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db-codegen/src/main/java/org/apache/empire/db/codegen/CodeGen.java
(original)
+++ incubator/empire-db/trunk/empire-db-codegen/src/main/java/org/apache/empire/db/codegen/CodeGen.java
Sun Sep 20 20:47:59 2009
@@ -21,6 +21,7 @@
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
 import java.sql.DriverManager;
+import java.sql.ResultSet;
 import java.util.logging.Logger;
 
 import org.apache.empire.commons.ErrorObject;
@@ -44,7 +45,7 @@
         try
         {
             // Init Configuration
-            config.init((args.length > 0 ? args[0] : "config.xml" ), false, true);
+            config.init((args.length > 0 ? args[0] : "config.xml" ));
 
             // Enable Exceptions
             ErrorObject.setExceptionsEnabled(true);
@@ -57,6 +58,11 @@
             
             // Process Metadata
             // ....
+            ResultSet rs = dmd.getCatalogs();
+            while (rs.next()) {
+                System.out.println(rs.getString(1));
+            }
+            rs.close();
             
         } catch(Exception e) {
             // Error

Modified: incubator/empire-db/trunk/empire-db-codegen/src/main/java/org/apache/empire/db/codegen/CodeGenConfig.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-codegen/src/main/java/org/apache/empire/db/codegen/CodeGenConfig.java?rev=817099&r1=817098&r2=817099&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db-codegen/src/main/java/org/apache/empire/db/codegen/CodeGenConfig.java
(original)
+++ incubator/empire-db/trunk/empire-db-codegen/src/main/java/org/apache/empire/db/codegen/CodeGenConfig.java
Sun Sep 20 20:47:59 2009
@@ -30,6 +30,25 @@
 
     private String jdbcPwd = "";
 
+    /**
+     * Initialize the configuration.
+     * 
+     * @param filename the file to read
+     * 
+     * @return true on succes
+     */
+    public boolean init(String filename)
+    {
+        // Read the properties file
+        if (super.init(filename, false, true) == false)
+            return false;
+        // Done
+        if (readProperties(this, "properties")==false)
+            return false;
+        // Reader Provider Properties
+        return true;
+    }
+    
     public String getJdbcClass()
     {
         return jdbcClass;



Mime
View raw message