db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-torque Wiki] Update of "OracleFAQ" by dkreutz
Date Fri, 02 Dec 2005 09:23:08 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-torque Wiki" for change notification.

The following page has been changed by dkreutz:

New page:

== Can I use Torque with Oracle ==

Yes, several people are using Torque and Oracle together successfully. Oracle Version 8i and
up are supported. You do however need to be aware of the issues outlined in the rest of this

== So what if I am using BLOBS, etc. ? ==

 1.  You will need a patched version of Village. The most recent version as of today (December
2005) is village-2.0-dev-oraclepatched-20041022.jar which is available at https://sweb.uky.edu/~skkann2/village/index.html

See also http://db.apache.org/torque/oracle-howto.html 

== What should i know when using Oracle's data type DATE and TIMESTAMP ==

Oracles data type DATE support date and time with an accuracy up to seconds, which is fine
for many applications. 
Since Version 9i Oracle introduced additional data type TIMESTAMP that supports additional
accuracy within fractions of seconds.
So far so good, but unfortunately Oracle broke in Version 9i the behaviour of its own JDBC-driver.
The JDBC-driver now returns for DATE only the date part and renders the time always as "00:00".

Only for TIMESTAMP full date and time are returned.

=== So what if I need exact date and time?  ===

 1. When generating your Torque-classes specify all columns as type="TIMESTAMP" in the schema.xml
for Torque-Generator, regardless if they are data type DATE or TIMESTAMP in your Oracle-schema.

 1. In your Oracle schema use data type TIMESTAMP for all columns where you need full date
and time. This is recommended when creating a new database schema. You can easily convert
DATE-columns to TIMESTAMP as Oracle casts these data types automatically (UPDATE mytable set
newTimestampColumn=oldDateColumn). For existing database (especially in production environment)
this may not be feasible:

 1. You may still use Oracles data type DATE. If you want correct time portion of the data
you must specify Java-VM parameter "-Doracle.jdbc.V8Compatible=true" that causes the JDBC-driver
to use old behaviour of JDBC-driver prior to Oracle 9i (returning full date and time for data
type DATE)

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

View raw message