mkalen 2005/03/02 08:25:28
Modified: src/java/org/apache/ojb/broker/platforms Tag:
OJB_1_0_RELEASE PlatformOracleImpl.java
. Tag: OJB_1_0_RELEASE release-notes.txt
Log:
Fix for ClassCastExceptions in Oracle JDBC-driver when using default platform
impl rs.setObject() and java.lang.Character. CharacterTest now passes with
Oracle9i.
Revision Changes Path
No revision
No revision
1.20.2.2 +14 -1
db-ojb/src/java/org/apache/ojb/broker/platforms/PlatformOracleImpl.java
Index: PlatformOracleImpl.java
===================================================================
RCS file:
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/platforms/PlatformOracleImpl.java,v
retrieving revision 1.20.2.1
retrieving revision 1.20.2.2
diff -u -r1.20.2.1 -r1.20.2.2
--- PlatformOracleImpl.java 26 Dec 2004 21:21:04 -0000 1.20.2.1
+++ PlatformOracleImpl.java 2 Mar 2005 16:25:28 -0000 1.20.2.2
@@ -155,6 +155,19 @@
}
ps.setCharacterStream(index, reader, length);
}
+ else if ((sqlType == Types.CHAR || sqlType == Types.VARCHAR)
+ &&
+ (value instanceof String || value instanceof Character))
+ {
+ if (value instanceof String)
+ {
+ ps.setString(index, (String) value);
+ }
+ else // assert: value instanceof Character
+ {
+ ps.setString(index, value.toString());
+ }
+ }
else
{
super.setObjectForStatement(ps, index, value, sqlType);
No revision
No revision
1.54.2.28 +3 -1 db-ojb/release-notes.txt
Index: release-notes.txt
===================================================================
RCS file: /home/cvs/db-ojb/release-notes.txt,v
retrieving revision 1.54.2.27
retrieving revision 1.54.2.28
diff -u -r1.54.2.27 -r1.54.2.28
--- release-notes.txt 25 Feb 2005 00:09:26 -0000 1.54.2.27
+++ release-notes.txt 2 Mar 2005 16:25:28 -0000 1.54.2.28
@@ -17,6 +17,8 @@
These archives are also available in the binary download area.
- Introduce first version of a two-level cache (transactional session cache
with an application cache
handle with copies of cached objects). More detailed information see
'object cache' reference guide in docs.
+- All Oracle platforms will now transparently handle java.lang.Character
fields mapped to
+ jdbc-types CHAR or VARCHAR, without any conversion class.
NOTES:
- Don't forget to replace the old repository.dtd and OJB.properties file
(both files changed).
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]