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:20:52 GMT
brj         2004/12/26 13:20:52

  Modified:    src/java/org/apache/ojb/broker/platforms
                        PlatformOracleImpl.java
  Log:
  Enables usage of SequenceManagerStoredProcedureImpl when OJB
  is running under Oracle. by Vadim Gritsenko.
  
  Revision  Changes    Path
  1.22      +27 -4     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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- PlatformOracleImpl.java	15 Aug 2004 22:39:10 -0000	1.21
  +++ PlatformOracleImpl.java	26 Dec 2004 21:20:51 -0000	1.22
  @@ -15,9 +15,6 @@
    * limitations under the License.
    */
   
  -import org.apache.ojb.broker.util.logging.Logger;
  -import org.apache.ojb.broker.util.logging.LoggerFactory;
  -
   import java.io.ByteArrayInputStream;
   import java.io.InputStreamReader;
   import java.io.Reader;
  @@ -25,6 +22,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;
  @@ -32,6 +30,9 @@
   import java.sql.Statement;
   import java.sql.Types;
   
  +import org.apache.ojb.broker.util.logging.Logger;
  +import org.apache.ojb.broker.util.logging.LoggerFactory;
  +
   /**
    * This class is a concrete implementation of <code>Platform</code>. Provides
an implementation
    * that works around some issues with Oracle in general and Oracle's Thin driver in particular.
  @@ -60,6 +61,28 @@
   
       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