Package java.sql

Examples of java.sql.CallableStatement.executeUpdate()


            ("? = CALL SYSIBM.CLOBGETPOSITIONFROMSTRING(?,?,?)");
        cs.registerOutParameter(1, java.sql.Types.BIGINT);
        cs.setInt(2, 1);
        cs.setString(3, new String("simple"));
        cs.setLong(4, 1L);
        cs.executeUpdate();
        //compare the substring position returned from the stored procedure and that
        //returned from the String class functions. If not found to be equal throw an
        //error.
        assertEquals("Error SYSIBM.CLOBGETPOSITIONFROMSTRING returns " +
            "the wrong value for the position of the SUBSTRING", testStr.indexOf("simple")+1, cs.getLong(1));
View Full Code Here


        int locator = -1;
        //call the stored procedure to return the created locator.
        CallableStatement cs  = prepareCall
            ("? = CALL SYSIBM.CLOBCREATELOCATOR()");
        cs.registerOutParameter(1, java.sql.Types.INTEGER);
        cs.executeUpdate();
        locator = cs.getInt(1);
        cs.close();

        //use this new locator to test the SETSUBSTRING function
        //by inserting a new sub string and testing whether it has
View Full Code Here

      callable = conn.prepareCall("{? = call test_function(?,101,?)}");
      callable.registerOutParameter(1, Types.BIGINT);

      callable.setString(2, "FOO");
      callable.setString(3, "BAR");
      callable.executeUpdate();
    } finally {
      if (callable != null) {
        callable.close();
      }
    }
View Full Code Here

      assertFalse(cStmt.execute());
      assertEquals(2f, cStmt.getInt(1), .001);
      assertEquals("java.lang.Integer", cStmt.getObject(1).getClass()
          .getName());

      assertEquals(-1, cStmt.executeUpdate());
      assertEquals(2f, cStmt.getInt(1), .001);
      assertEquals("java.lang.Integer", cStmt.getObject(1).getClass()
          .getName());

      if (!isRunningOnJdk131()) {
View Full Code Here

        assertFalse(cStmt.execute());
        assertEquals(4f, cStmt.getInt(1), .001);
        assertEquals("java.lang.Integer", cStmt.getObject(1).getClass()
            .getName());

        assertEquals(-1, cStmt.executeUpdate());
        assertEquals(4f, cStmt.getInt(1), .001);
        assertEquals("java.lang.Integer", cStmt.getObject(1).getClass()
            .getName());
      }
View Full Code Here

      assertEquals(0f, cStmt.getInt(1), .001);
      assertEquals(true, cStmt.wasNull());
      assertEquals(null, cStmt.getObject(1));
      assertEquals(true, cStmt.wasNull());

      assertEquals(-1, cStmt.executeUpdate());
      assertEquals(0f, cStmt.getInt(1), .001);
      assertEquals(true, cStmt.wasNull());
      assertEquals(null, cStmt.getObject(1));
      assertEquals(true, cStmt.wasNull());
View Full Code Here

      assertFalse(cStmt.execute());
      assertEquals(4f, cStmt.getInt(1), .001);
      assertEquals("java.lang.Integer", cStmt.getObject(1).getClass()
          .getName());

      assertEquals(-1, cStmt.executeUpdate());
      assertEquals(4f, cStmt.getInt(1), .001);
      assertEquals("java.lang.Integer", cStmt.getObject(1).getClass()
          .getName());

      if (!isRunningOnJdk131()) {
View Full Code Here

              + "\nEND");

      CallableStatement cstmt = this.conn
          .prepareCall("{call sp_testBug25379(?)}");
      cstmt.setString(1, "'john'");
      cstmt.executeUpdate();
      assertEquals("'john'", cstmt.getString(1));
      assertEquals("'john'", getSingleValue("testBug25379", "col", "")
          .toString());
    } finally {
      this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS sp_testBug25379");
View Full Code Here

        cstmt.setBinaryStream("mblob", new ByteArrayInputStream(buf),
            buf.length);
        cstmt.registerOutParameter("mblob", typesToTest[i]);

        cstmt.executeUpdate();

        InputStream is = cstmt.getBlob("mblob").getBinaryStream();
        ByteArrayOutputStream bOut = new ByteArrayOutputStream();

        int bytesRead = 0;
View Full Code Here

      callable.registerOutParameter(1, Types.BIGINT);

      // Add row with non-null value
      callable.setLong(2, 1);
      callable.setString(3, "Non-null value");
      callable.executeUpdate();
      assertEquals(1, callable.getLong(1));

      // Add row with null value
      callable.setLong(2, 2);
      callable.setNull(3, 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.