Examples of registerOutParameter()


Examples of com.alibaba.druid.proxy.jdbc.CallableStatementProxyImpl.registerOutParameter()

        CallableStatementProxyImpl rawCallStatement = new FakeCallableStatement(new ConnectionProxyImpl(null, null, null, 0), null, sql, 1001);

        ConnectionProxy connection = new ConnectionProxyImpl(dataSource, null, new Properties(), 1001);
        CallableStatementProxyImpl cstmt = new CallableStatementProxyImpl(connection, rawCallStatement, sql, 2001);

        cstmt.registerOutParameter(1, Types.VARCHAR);
        cstmt.registerOutParameter(1, Types.VARCHAR, "VARCHAR");
        cstmt.registerOutParameter(1, Types.VARCHAR, 3);

        cstmt.registerOutParameter("1", Types.VARCHAR);
        cstmt.registerOutParameter("1", Types.VARCHAR, "VARCHAR");
View Full Code Here

Examples of java.sql.CallableStatement.registerOutParameter()

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

        stat.execute("drop alias array_test");
View Full Code Here

Examples of java.sql.CallableStatement.registerOutParameter()

    private void testCallWithResult(Connection conn) throws SQLException {
        CallableStatement call;
        for (String s : new String[]{"{?= call abs(?)}", " { ? = call abs(?)}", " {? = call abs(?)}"}) {
            call = conn.prepareCall(s);
            call.setInt(2, -3);
            call.registerOutParameter(1, Types.INTEGER);
            call.execute();
            assertEquals(3, call.getInt(1));
            call.executeUpdate();
            assertEquals(3, call.getInt(1));
        }
View Full Code Here

Examples of java.sql.CallableStatement.registerOutParameter()

        call = conn.prepareCall("{CALL testCall(?,?,?)}");
        call.setInt("A", 100);
        call.setString(2, "abc");
        long t = System.currentTimeMillis();
        call.setTimestamp("C", new Timestamp(t));
        call.registerOutParameter(1, Types.INTEGER);
        call.registerOutParameter("B", Types.VARCHAR);
        call.executeUpdate();
        try {
            call.getTimestamp("C");
            fail("not registered out parameter accessible");
View Full Code Here

Examples of java.sql.CallableStatement.registerOutParameter()

        call.setInt("A", 100);
        call.setString(2, "abc");
        long t = System.currentTimeMillis();
        call.setTimestamp("C", new Timestamp(t));
        call.registerOutParameter(1, Types.INTEGER);
        call.registerOutParameter("B", Types.VARCHAR);
        call.executeUpdate();
        try {
            call.getTimestamp("C");
            fail("not registered out parameter accessible");
        } catch (SQLException e) {
View Full Code Here

Examples of java.sql.CallableStatement.registerOutParameter()

            call.getTimestamp("C");
            fail("not registered out parameter accessible");
        } catch (SQLException e) {
            // expected exception
        }
        call.registerOutParameter(3, Types.TIMESTAMP);
        call.executeUpdate();
        assertEquals(t + 1, call.getTimestamp(3).getTime());
        assertEquals(200, call.getInt("A"));
        assertEquals("ABC", call.getString("B"));
        try {
View Full Code Here

Examples of java.sql.CallableStatement.registerOutParameter()

      {
        final CallableStatement pstmt = getConnection(parameters).prepareCall
            (translatedQuery, getBestResultSetType(parameters), ResultSet.CONCUR_READ_ONLY);
        if (isCallableStatementQuery(translatedQuery))
        {
          pstmt.registerOutParameter(1, Types.OTHER);
          parametrize(parameters, preparedParameterNames, pstmt, false, 1);
        }
        else
        {
          parametrize(parameters, preparedParameterNames, pstmt, false, 0);
View Full Code Here

Examples of java.sql.CallableStatement.registerOutParameter()

  {
    CallableStatement stmt = _callable;
    if (stmt != null) {
      try {
        if (scale == null) {
          stmt.registerOutParameter(column, type);
        } else {
          stmt.registerOutParameter(column, type, scale.toInt());
        }
      } catch (SQLException e) {
        throw context.exception(e);
View Full Code Here

Examples of java.sql.CallableStatement.registerOutParameter()

    if (stmt != null) {
      try {
        if (scale == null) {
          stmt.registerOutParameter(column, type);
        } else {
          stmt.registerOutParameter(column, type, scale.toInt());
        }
      } catch (SQLException e) {
        throw context.exception(e);
      }
    }
View Full Code Here

Examples of java.sql.CallableStatement.registerOutParameter()

      oStmt = oConn.prepareCall("{ call k_sp_read_microsite (?,?,?,?,?) }");

      clear();

      oStmt.setObject(1, aPK[0], Types.CHAR);       // gu_microsite
      oStmt.registerOutParameter(2, Types.INTEGER); // id_app
      oStmt.registerOutParameter(3, Types.VARCHAR); // nm_microsite
      oStmt.registerOutParameter(4, Types.VARCHAR); // path_metadata
      oStmt.registerOutParameter(5, Types.CHAR);    // gu_workarea

      if (DebugFile.trace) DebugFile.writeln("CallableStatement.execute()");
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.