empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1293706 - in /empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql: DBDatabaseDriverPostgreSQL.java PostgreDDLGenerator.java
Date Sat, 25 Feb 2012 22:13:31 GMT
Author: doebele
Date: Sat Feb 25 22:13:31 2012
New Revision: 1293706

URL: http://svn.apache.org/viewvc?rev=1293706&view=rev
Log:
EMPIREDB-132
added suggestions reported by Vladimir Lahoda

Modified:
    empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
    empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/PostgreDDLGenerator.java

Modified: empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java?rev=1293706&r1=1293705&r2=1293706&view=diff
==============================================================================
--- empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
(original)
+++ empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
Sat Feb 25 22:13:31 2012
@@ -19,6 +19,7 @@
 package org.apache.empire.db.postgresql;
 
 import java.sql.Connection;
+import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.GregorianCalendar;
 
@@ -450,4 +451,19 @@ public class DBDatabaseDriverPostgreSQL 
         ddlGenerator.getDDLScript(type, dbo, script); 
     }
     
+    /**
+     * Postgre needs special handling for CLOBs
+     */
+    @Override
+    public Object getResultValue(ResultSet rset, int columnIndex, DataType dataType)
+        throws SQLException
+    {
+        if (dataType == DataType.CLOB)
+        {
+            return rset.getString(columnIndex);
+        }
+        // default handling
+        return super.getResultValue(rset, columnIndex, dataType);
+    }
+    
 }

Modified: empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/PostgreDDLGenerator.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/PostgreDDLGenerator.java?rev=1293706&r1=1293705&r2=1293706&view=diff
==============================================================================
--- empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/PostgreDDLGenerator.java
(original)
+++ empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/PostgreDDLGenerator.java
Sat Feb 25 22:13:31 2012
@@ -45,6 +45,7 @@ public class PostgreDDLGenerator extends
     private void initDataTypes()
     {   // Override data types
         DATATYPE_BOOLEAN = "BOOLEAN";
+        DATATYPE_CLOB = "TEXT";
     }
 
     @Override



Mime
View raw message