db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brendan Miller" <bmil...@dotster.com>
Subject Village Oracle DATE<=>Timestamp patch?
Date Mon, 26 Nov 2007 17:59:58 GMT

Thanks Greg, for getting on that last one so fast.  I'm on my way with
this Oracle DATE/TIMESTAMP issue.  I still cannot find the Village patch 
that is mentioned in mailing list archives, so I am rolling my own.  I'm
still not sure if patching Village is the way to go, or if I should just
use the -Doracle.jdbc.V8Compatible=true JVM paramter mentioned in the
Wiki.

If Village was to be patched, is this totally crazy?

Index: src/java/com/workingdogs/village/Column.java
===================================================================
--- src/java/com/workingdogs/village/Column.java    (revision 21344)
+++ src/java/com/workingdogs/village/Column.java    (working copy)
@@ -139,6 +139,17 @@
         this.nullAllowed = rsmd.isNullable(columnNumber) == 1;
         this.autoIncrement = rsmd.isAutoIncrement(columnNumber);
 
+       // ORACLE DATE BUGFIX / HACK
+       // Oracle 9.2+ returns DATE SQL type for DATE columns, even though it
+       // can store hour/minute/second info.  Bend Oracle DATE columns to
+       // make Village believe they are timestamp fields
+       if (rsmd.getClass().getName().equals(
+                   "oracle.jdbc.driver.OracleResultSetMetaData") && 
+               this.columnType == Types.DATE) {
+           this.columnTypeName = "TIMESTAMP";
+           this.columnType = Types.TIMESTAMP;
+       }
+
         // The JDBC spec is VERY unclear about what this means and as 
         // such, it should be ignored.  Derby returns true all the time.
         // Sybase and Informix say it's unsupported (and false).


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message