db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hendrik Busch <hendrik.bu...@lexisnexis.de>
Subject Re: BLOB and CLOB Torque datatypes
Date Wed, 11 May 2005 07:37:55 GMT

> I also have to try Fabios information of using the oracle 10g driver
> regarding LOBs. I have committed a testcase yesterday which checks reading
> and writing long(100kB) byte array and string into BLOBs and CLOBs, see if
> that runs with the "normal" village library.

As Fabio pointed out, the 10g JDBC drivers are a great improvement. They 
work correctly with BLOB but for writing Strings with more than 32768 
(2^15) character will result in an SQLException. When using the 
PreparedStament class, you can cast it into the Oracle specific class 
and use the method setStringForClob().
(Oracle guidelines do not encourage the use of setBytes() and 
setBinaryStream() - the recommended way is inserting a blank BLOB/CLOB, 
then selecting it and setting the new values via the Blob and Clob 
classes - a rather complicated way).

 > My short term suggestion: always use TIMESTAMP, stick with the 
current > one adapter function but rigidly using the timestamp format, and
 > change the MySQL mapping of TIMESTAMP to DATETIME. This should support
 > 99% of all current applications. This would leave a problem only with
 > TIME fields, which cannot be handled by TIMESTAMP fields.

This maybe a problem for those who rely on the MySQL specific "magic" 
behaviour of TIMESTAMP columns. I know that this behaviour does not 
conform with SQL92 or any other version but many people still rely on 
this. TIMESTAMP columns are automatically set when a new row is created 
and are updated automatically when at least one value in a row changes. 
So TIMESTAMP can be used as a "last modified" marker in the database 
without the need of programming this behaviour in Java. The above does 
not apply when running MySQL in MaxDB mode - in that case, TIMESTAMP 
columns are automatically treated as DATETIME. I suggest reading


Don't get me wrong, I don't discourage the use of DATETIME instead of 
TIMESTAMP, I just want to show the problem associated with it.

So long,
Hendrik Busch

Mit freundlichen Grüßen / Kind regards

Hendrik Busch - Teamleiter LexisNexis Recht Entwicklung

LexisNexis Deutschland GmbH
Feldstiege 100
D-48161 Münster
phone +49 (0) 2533-9300-455
fax +49 (0) 02533-9300-50

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

View raw message