Package java.sql

Examples of java.sql.CallableStatement.clearParameters()


        cs.execute();
        assertEquals(10, cs.getInt(1));

        // After clearing the parameters, execution should fail. Client used
        // to succeed.
        cs.clearParameters();
        assertStatementError("07000", cs);

        // Setting the parameter again should make it work.
        cs.setInt(1, 1);
        cs.execute();
View Full Code Here


            fail("FAIL - execution ok on out of range out parameter");
        } catch (SQLException sqle) {
            assertSQLState("22003", sqle);
        }

        op.clearParameters();
        try {
            // b not set
            op.execute();

            fail("FAIL - b not set");
View Full Code Here

        } catch (SQLException sqle) {
            assertSQLState("22003", sqle);
        }

        // now some checks to requirements for parameter setting.
        op.clearParameters();
        try {
            // a,b not set
            op.execute();
            fail("FAIL - a,b not set");
        } catch (SQLException sqle) {
View Full Code Here

            op.execute();
            fail("FAIL - a,b not set");
        } catch (SQLException sqle) {
            assertSQLState("07000", sqle);
        }
        op.clearParameters();
        op.setString(2, "2");
        try {
            // a not set
            op.execute();
            fail("FAIL - a  not set");
View Full Code Here

            op.execute();
            fail("FAIL - a  not set");
        } catch (SQLException sqle) {
            assertSQLState("07000", sqle);
        }
        op.clearParameters();
        op.setBigDecimal(1, new BigDecimal("33"));
        try {
            // b not set
            op.execute();
            fail("FAIL - b  not set");
View Full Code Here

    cstmt.registerOutParameter(1, Types.INTEGER);
    cstmt.execute();
    assertEquals(1, cstmt.getInt(1));

    if (!isRunningOnJdk131()) {
      cstmt.clearParameters();
      cstmt.registerOutParameter("param2", Types.INTEGER);
      cstmt.execute();
      assertEquals(1, cstmt.getInt(1));
    }
View Full Code Here

      cStmt.setInt(1, 5);
      cStmt.registerOutParameter(2, Types.INTEGER);

      cStmt.execute();
      assertEquals(6, cStmt.getInt(2));
      cStmt.clearParameters();
      cStmt.close();

      this.conn.setCatalog("bug57022");
      cStmt = this.conn.prepareCall("{call bug57022.procbug57022(?, ?)}");
      cStmt.setInt(1, 5);
View Full Code Here

      cStmt.setInt(1, 5);
      cStmt.registerOutParameter(2, Types.INTEGER);

      cStmt.execute();
      assertEquals(6, cStmt.getInt(2));
      cStmt.clearParameters();
      cStmt.close();

      this.conn.setCatalog("mysql");
      cStmt = this.conn
          .prepareCall("{call `bug57022`.`procbug57022`(?, ?)}");
View Full Code Here

      cStmt.registerOutParameter(2, Types.INTEGER);

      cStmt.execute();
      assertEquals(6, cStmt.getInt(2));
    } finally {
      cStmt.clearParameters();
      cStmt.close();
      this.conn.setCatalog(originalCatalog);
    }

  }
View Full Code Here

            indexedOutParamToTest == namedOutParamToTest);
        assertTrue("Output value not returned correctly",
            indexedOutParamToTest == 6);

        // Start over, using named parameters, this time
        storedProc.clearParameters();
        storedProc.setInt("x", 32);
        storedProc.registerOutParameter("y", Types.INTEGER);

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