commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30749] New: - Oracle 9.2.0 JDBC Timestamp Problem
Date Thu, 19 Aug 2004 10:07:42 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30749>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30749

Oracle 9.2.0 JDBC Timestamp Problem

           Summary: Oracle 9.2.0 JDBC Timestamp Problem
           Product: Commons
           Version: Nightly Builds
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: DbUtils
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: rmoser@datacomm.ch


I just run into a Timestamp problem with the Oracle 9i (9.2.0) JDBC Driver.

When calling rs.getObject(index) on a DB field, defined as Timestamp(6),
the resulting object is a oracle.sql.TIMESTAMP and not a java.sql.Timestamp as
with other JDBC Drivers.

This leads to a null value propagation if your Bean Property is defined as
java.sql.Timestamp.
 
If calling rs.getTimestamp(index), Oracle correctly converts the 
resulting value to a java.sql.Timestamp object.
 
The following addition to the processColumn Method of the BeanProcessor class
whould solve the problem.
 
 } else if(propType.equals(Timestamp.class)) {
         return rs.getTimestamp(index);
 
This ensures that for a Bean property of type java.sql.Timestamp the 
getTimestamp() method is called.
Otherwise the default getObject() mehod is called, so there souldn't be 
a problem if someone wants the Oracle enhanced oracle.sql.TIMESTAMP
object.
 
Regards
Rolf

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


Mime
View raw message