db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r331873 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java
Date Tue, 08 Nov 2005 19:54:55 GMT
Author: mvdb
Date: Tue Nov  8 11:54:52 2005
New Revision: 331873

URL: http://svn.apache.org/viewcvs?rev=331873&view=rev
Log:
Try to get the catalogname, so we can use it when querying tables.
Tested on mysql 4.1. Fixes DDLUTILS-33 partially. SqlServer is untested at this moment.

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java?rev=331873&r1=331872&r2=331873&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java Tue Nov 
8 11:54:52 2005
@@ -172,6 +172,22 @@
     {
         Database db = new Database();
 
+        try 
+        {
+            db.setName(connection.getCatalog());
+            if (catalog == null)
+            {
+                catalog = db.getName();
+            }
+        } 
+        catch(Exception e) 
+        {
+            _log.info("Cannot determine the catalog name from connection.");
+            if (catalog != null)
+            {
+                db.setName(catalog);
+            }
+        }
         for (Iterator it = getTables(connection, catalog, schema, tableTypes).iterator();
it.hasNext();)
         {
             db.addTable((Table)it.next());



Mime
View raw message