db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/platforms PlatformOracleImpl.java
Date Sun, 26 Dec 2004 21:21:04 GMT
brj         2004/12/26 13:21:04

  Modified:    src/java/org/apache/ojb/broker/platforms Tag:
                        OJB_1_0_RELEASE PlatformOracleImpl.java
  Log:
  Enables usage of SequenceManagerStoredProcedureImpl when OJB
  is running under Oracle. by Vadim Gritsenko.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.20.2.1  +24 -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
  retrieving revision 1.20.2.1
  diff -u -r1.20 -r1.20.2.1
  --- PlatformOracleImpl.java	22 May 2004 09:55:33 -0000	1.20
  +++ PlatformOracleImpl.java	26 Dec 2004 21:21:04 -0000	1.20.2.1
  @@ -25,6 +25,7 @@
   import java.lang.reflect.Field;
   import java.security.AccessController;
   import java.security.PrivilegedAction;
  +import java.sql.CallableStatement;
   import java.sql.Connection;
   import java.sql.DatabaseMetaData;
   import java.sql.PreparedStatement;
  @@ -48,6 +49,28 @@
       // Oracle:thin handles direct CLOB insert and update <= 4000
       protected static final int THIN_CLOB_MAX_SIZE = 4000;
       private Logger logger = LoggerFactory.getLogger(PlatformOracleImpl.class);
  +
  +    /**
  +     * Method prepareNextValProcedureStatement implementation 
  +     * is simply copied over from PlatformMsSQLServerImpl class.
  +     * @see org.apache.ojb.broker.platforms.Platform#prepareNextValProcedureStatement(java.sql.Connection,
java.lang.String, java.lang.String)
  +     */
  +    public CallableStatement prepareNextValProcedureStatement(Connection con, String procedureName,
String sequenceName)
  +            throws PlatformException
  +    {
  +        try
  +        {
  +            String sp = "{?= call " + procedureName + " (?)}";
  +            CallableStatement cs = con.prepareCall(sp);
  +            cs.registerOutParameter(1, Types.INTEGER);
  +            cs.setString(2, sequenceName);
  +            return cs;
  +        }
  +        catch (SQLException e)
  +        {
  +            throw new PlatformException(e);
  +        }
  +    }
   
       /**
        * In Oracle we set escape processing explizit 'true' after a statement was created.
  
  
  

---------------------------------------------------------------------
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