Examples of prepareCall()


Examples of com.alibaba.druid.pool.DruidPooledConnection.prepareCall()

        conn.getConnection().close();
        {
            SQLException error = null;
            try {
                conn.prepareCall("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,
                                 ResultSet.HOLD_CURSORS_OVER_COMMIT);
            } catch (SQLException ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
View Full Code Here

Examples of com.knowgate.jdc.JDCConnection.prepareCall()

          oStmt.executeQuery("SELECT k_sp_del_mime_msg('" + oDeleted.getString(0,d) + "')");
        oStmt.close();
        oStmt=null;
      }
      else {
        oCall = oConn.prepareCall("{ call k_sp_del_mime_msg(?) }");

        for (int d=0; d<iDeleted; d++) {
          oCall.setString(1, oDeleted.getString(0,d));
          oCall.execute();
        } // next
View Full Code Here

Examples of java.sql.Connection.prepareCall()

        stmt.setObject(1, new Integer[] { 1, 2 });
        rs = stmt.executeQuery();
        rs.next();
        assertEquals(Integer[].class.getName(), rs.getObject(1).getClass().getName());

        CallableStatement call = conn.prepareCall("{ ? = call array_test(?) }");
        call.setObject(2, new Integer[] { 2, 1 });
        call.registerOutParameter(1, Types.ARRAY);
        call.execute();
        assertEquals(Integer[].class.getName(), call.getArray(1).getArray().getClass().getName());
        assertEquals(new Integer[] { 2, 1 }, (Integer[]) call.getObject(1));
View Full Code Here

Examples of java.sql.Connection.prepareCall()

    Command command = TranslationHelper.helpTranslate(TranslationHelper.BQT_VDB, "exec pm2.spTest8a()"); //$NON-NLS-1$
    Connection connection = Mockito.mock(Connection.class);
    CallableStatement cs = Mockito.mock(CallableStatement.class);
    Mockito.stub(cs.getUpdateCount()).toReturn(-1);
    Mockito.stub(cs.getInt(1)).toReturn(5);
    Mockito.stub(connection.prepareCall("{  call spTest8a(?)}")).toReturn(cs); //$NON-NLS-1$
    JDBCExecutionFactory ef = new JDBCExecutionFactory();
   
    JDBCProcedureExecution procedureExecution = new JDBCProcedureExecution(command, connection, Mockito.mock(ExecutionContext.class),  ef);
    procedureExecution.execute();
    assertEquals(Arrays.asList(5), procedureExecution.getOutputParameterValues());
View Full Code Here

Examples of java.sql.Connection.prepareCall()

    Command command = TranslationHelper.helpTranslate(TranslationHelper.BQT_VDB, "exec pm2.spTest8(1)"); //$NON-NLS-1$
    Connection connection = Mockito.mock(Connection.class);
    CallableStatement cs = Mockito.mock(CallableStatement.class);
    Mockito.stub(cs.getUpdateCount()).toReturn(-1);
    Mockito.stub(cs.getInt(2)).toReturn(5);
    Mockito.stub(connection.prepareCall("{  call spTest8(?,?)}")).toReturn(cs); //$NON-NLS-1$
    JDBCExecutionFactory config = new JDBCExecutionFactory();

    JDBCProcedureExecution procedureExecution = new JDBCProcedureExecution(command, connection, Mockito.mock(ExecutionContext.class), config);
    procedureExecution.execute();
    assertEquals(Arrays.asList(5), procedureExecution.getOutputParameterValues());
View Full Code Here

Examples of java.sql.Connection.prepareCall()

        DeleteDbFiles.execute("memFS:", "lob", true);
        Connection conn = org.h2.Driver.load().connect("jdbc:h2:memFS:lob", null);
        Statement stat = conn.createStatement();
        stat.execute("create table test(d blob)");
        stat.execute("set MAX_LENGTH_INPLACE_LOB 1");
        PreparedStatement prep = conn.prepareCall("insert into test values('0000')");
        // long start = System.currentTimeMillis();
        for (int i = 0; i < 2000; i++) {
            // if (i % 1000 == 0) {
            //     long now = System.currentTimeMillis();
            //     System.out.println(i + " " + (now - start));
View Full Code Here

Examples of java.sql.Connection.prepareCall()

  public Any m_call(Context context, String query)
  {
    Connection conn = null;
    try {
      conn = getConnection();
      CallableStatement stmt = conn.prepareCall(query);
      return new AnyStatement(stmt);
    } catch (SQLException e) {
      if (conn != null) {
        try {
          conn.close();
View Full Code Here

Examples of java.sql.Connection.prepareCall()

         }

         {
            sql = "{? = call " + this.replPrefix + "check_tables(?,?,?,?,NULL)}"; // name text, content text)
            try {
               CallableStatement st = conn.prepareCall(sql);
               st.setString(2, "dbName");    // database name
               st.setString(3, "schema");
               st.setString(4, "table");
               st.setString(5, "COMMAND");
               st.registerOutParameter(1, Types.VARCHAR);
View Full Code Here

Examples of java.sql.Connection.prepareCall()

         }

         {
            sql = "{? = call " + this.replPrefix + "check_tables(?,?,?,?,?)}"; // name text, content text)
            try {
               CallableStatement st = conn.prepareCall(sql);
               st.setString(2, "dbName");    // database name
               st.setString(3, "schema");
               st.setString(4, "table");
               st.setString(5, "COMMAND");
               st.setString(6, "TEST CONTENT");
View Full Code Here

Examples of java.sql.Connection.prepareCall()

                  this.pool.update("DELETE FROM " + "TEST_REPLICATION");
               }
               catch (Exception e) {
               }

               CallableStatement st = conn.prepareCall(sql);
               st.setString(2, null);
               st.setString(3, this.specificHelper.getOwnSchema(this.pool));
               st.setString(4, "TEST_REPLICATION");
               st.setString(5, "CREATE");
               st.registerOutParameter(1, Types.VARCHAR);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.