Package java.sql

Examples of java.sql.CallableStatement.clearParameters()


      int indexedOutParamToTest = storedProc.getInt(2);

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

      storedProc.clearParameters();
      storedProc.setInt(1, 32);
      storedProc.registerOutParameter(2, Types.INTEGER);

      storedProc.execute();
View Full Code Here


        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

      catch(SQLException e) {
        System.out.println("Callable Statement Test failed");
      }

      try {
        cs.clearParameters();
        System.out.println("Callable Statement Test failed");
      }
      catch(SQLException e) { }

      try {
View Full Code Here

      cs.registerOutParameter(2, Types.INTEGER);
      cs.setInt(1, i);
      cs.execute();
      assertEquals(1, cs.getInt(1));
      assertEquals(i, cs.getInt(2));
      cs.clearParameters();
    }
    cs.close();
  }

  @Test
View Full Code Here

      catch(SQLException e) {
        System.out.println("Callable Statement Test failed");
      }

      try {
        cs.clearParameters();
        System.out.println("Callable Statement Test failed");
      }
      catch(SQLException e) { }

      try {
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

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.