Package oracle.jdbc

Examples of oracle.jdbc.OraclePreparedStatement


     * @return
     * @throws SQLException
     */
    @Override
    public boolean registerPreparedStatementReturnParam(String sqlText, PreparedStatement ps, int idx) throws SQLException {
        OraclePreparedStatement ops = (OraclePreparedStatement) ps;
        Pattern p = Pattern.compile("^\\s*INSERT.+RETURNING.+INTO\\s+", Pattern.CASE_INSENSITIVE);
        Matcher m = p.matcher(sqlText);
        if (m.find()) {
            ops.registerReturnParameter(idx, Types.BIGINT);
            return true;
        }
        return false;
    }
View Full Code Here


     * @return
     * @throws SQLException
     */
    @Override
    public long getPreparedStatementReturnParam(PreparedStatement ps) throws SQLException {
        OraclePreparedStatement ops = (OraclePreparedStatement) ps;
        ResultSet rs = ops.getReturnResultSet();
        try {
            if (rs.next()) {
                // Assuming that primary key will not be larger as long max value
                return rs.getLong(1);
            }
View Full Code Here

    {
      if(logger.isDebugEnabled())
        logger.debug("setSqlValue(value={}, column={}, statement={}) - start",
            new Object[]{value, new Integer(column), statement} );

        OraclePreparedStatement oraclePreparedStatement = (OraclePreparedStatement) statement;
        oraclePreparedStatement.setFormOfUse(column, OraclePreparedStatement.FORM_NCHAR);
        statement.setObject(column, getClob(value, statement.getConnection()));
    }
View Full Code Here

        return typeCast(data);
    }

    public void setSqlValue(Object value, int column, PreparedStatement statement) throws SQLException, TypeCastException
    {
        OraclePreparedStatement oraclePreparedStatement = (OraclePreparedStatement) statement;
        OpaqueDescriptor opaqueDescriptor = OpaqueDescriptor.createDescriptor("SYS.XMLTYPE", statement.getConnection());
        OPAQUE opaque = new OPAQUE(opaqueDescriptor, (byte[]) typeCast(value), statement.getConnection());
        oraclePreparedStatement.setOPAQUE(column, opaque);
    }
View Full Code Here

//           
//            PreparedStatement stmt2 = conn.prepareStatement(SQL);
//            stmt2.close();
//        }

        OraclePreparedStatement oracleStmt = null;
        PreparedStatement stmt = conn.prepareStatement(SQL);
        oracleStmt = (OraclePreparedStatement) stmt;
        oracleStmt.setRowPrefetch(10);
        {

            stmt.setInt(1, 327);
            ResultSet rs = stmt.executeQuery();
            while (rs.next()) {

            }

            rs.close();

            //oracleStmt.clearDefines();
        }
        for (int i = 0; i < 10; ++i){
            OracleUtils.enterImplicitCache(oracleStmt);
            OracleUtils.exitImplicitCacheToActive(oracleStmt);
            stmt.setInt(1, 327);
            ResultSet rs = stmt.executeQuery();
            while (rs.next()) {
               
            }
           
            rs.close();
           
        }
       
        oracleStmt.setRowPrefetch(1000);
        {
            stmt.setInt(1, 11);
            ResultSet rs = stmt.executeQuery();
            rs.next();
View Full Code Here

TOP

Related Classes of oracle.jdbc.OraclePreparedStatement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.