empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From franci...@apache.org
Subject svn commit: r790710 - /incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
Date Thu, 02 Jul 2009 18:53:30 GMT
Author: francisdb
Date: Thu Jul  2 18:53:30 2009
New Revision: 790710

URL: http://svn.apache.org/viewvc?rev=790710&view=rev
Log:
fix some type conversions for the postgre driver (suggested by Frank Lupo)

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

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java?rev=790710&r1=790709&r2=790710&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
Thu Jul  2 18:53:30 2009
@@ -307,23 +307,20 @@
     @Override
     public String getConvertPhrase(DataType destType, DataType srcType, Object format)
     {
-        switch(destType)
+        switch (destType)
         {
-           case BOOL:      return "CAST(? AS UNSIGNED)";
-           case INTEGER:   return "CAST(? AS SIGNED)";
-           case DECIMAL:   return "CAST(? AS DECIMAL)";
-           case DOUBLE:    return "CAST(? AS DECIMAL)";
-           case DATE:      return "CAST(? AS DATE)";
-           case DATETIME:  return "CAST(? AS DATETIME)";
-           // Convert to text
-           case TEXT:
-                return "CAST(? AS CHAR)";
-           case BLOB:
-                return "CAST(? AS bytea)";
-           case CLOB:
-                return "CAST(? AS TEXT)";
-           // Unknown Type                                       
-           default:
+            case BOOL:     return "CAST(? AS BOOL)";
+            case INTEGER:  return "CAST(? AS INTEGER)";
+            case DECIMAL:  return "CAST(? AS DECIMAL)";
+            case DOUBLE:   return "CAST(? AS DECIMAL)";
+            case DATE:     return "CAST(? AS DATE)";
+            case DATETIME: return "CAST(? AS TIMESTAMP)";
+                // Convert to text
+            case TEXT:     return "CAST(? AS CHAR)";
+            case BLOB:     return "CAST(? AS bytea)";
+            case CLOB:     return "CAST(? AS TEXT)";
+                // Unknown Type
+            default:
                 log.error("getConvertPhrase: unknown type (" + String.valueOf(destType));
                 return "?";
         }



Mime
View raw message