db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mka...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/platforms PlatformOracleImpl.java
Date Fri, 11 Mar 2005 17:12:29 GMT
mkalen      2005/03/11 09:12:29

  Modified:    src/java/org/apache/ojb/broker/platforms
                        PlatformOracleImpl.java
  Log:
  Merge with OJB_1_0_RELEASE branch: 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
  1.23      +15 -2     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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- PlatformOracleImpl.java	26 Dec 2004 21:20:51 -0000	1.22
  +++ PlatformOracleImpl.java	11 Mar 2005 17:12:28 -0000	1.23
  @@ -180,6 +180,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);
  @@ -273,7 +286,7 @@
        */
       protected static boolean isUsingOracleOCIDriver(Connection conn)
       {
  -        String dbUrl = getDbUrl(conn);
  +        final String dbUrl = getDbUrl(conn);
           return dbUrl != null && dbUrl.startsWith(OCI_URL_PREFIX);
       }
   
  
  
  

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


Mime
View raw message