Package java.sql

Examples of java.sql.CallableStatement.executeUpdate()


        call.execute();
        rs = call.getResultSet();
        rs.next();
        assertEquals(10, rs.getInt(1));

        call.executeUpdate();
        rs = call.getResultSet();
        rs.next();
        assertEquals(10, rs.getInt(1));

    }
View Full Code Here


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

    private void testPrepare(Connection conn) throws SQLException {
View Full Code Here

        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) {
            // expected exception
View Full Code Here

            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 {
            call.getString(100);
View Full Code Here

         try {
            st = conn.prepareCall(incRefCounterInvoke);
            st.setLong(1, meat.getId());
            st.setLong(2, store.getId());
            st.setLong(3, increment);
            st.executeUpdate();
         } finally {
            if (st != null)
               st.close();
         }
      } else {
View Full Code Here

            logger.debug9(".. " + NLS_DATE_FORMAT + " successfully set.");
            logger.debug9(".. " + NLS_SORT + " successfully set.");
            CallableStatement enable_stmt = null;
            enable_stmt = this.getConnection().prepareCall(
                    "begin dbms_output.enable(10000); end;");
            enable_stmt.executeUpdate();
        } catch (Exception e) {
            throw e;
        } finally {
            try {
                if (stmt != null) stmt.close();
View Full Code Here

           
            // Set to be read-only via the procedure which uses
            // the normal user name.
            csSetAccess.setString(1, normalUserName);
            csSetAccess.setString(2, "READONLYACCESS");
            csSetAccess.executeUpdate();
            commit();
           
            connUser = openDefaultConnection(jdbcUserName, password);
            // DERBY-2738 (network client always returns false for isReadOnly)
            if (usingEmbedded())
View Full Code Here

        stmt.setInt(2, 2);
        stmt.registerOutParameter(3, Types.VARCHAR);
        stmt.setInt(4, 4);
        stmt.registerOutParameter(5, Types.DATE);

        stmt.executeUpdate();

        assertEquals(1, stmt.getInt(1));
        assertFalse(stmt.wasNull());
        assertEquals("1", stmt.getString(3));
        assertFalse(stmt.wasNull());
View Full Code Here

    updcount = ps.executeUpdate();

    CallableStatement cstmt = conn.prepareCall("{call Longvarbinary_In(?)}");
    cstmt.setObject(1,bytearr,java.sql.Types.LONGVARBINARY);
    System.out.println("execute the procedure with LONGVARBINARY");
    cstmt.executeUpdate();
    cstmt.setObject(1,bytearr,java.sql.Types.BLOB);
    System.out.println("execute the procedure with BLOB");
    cstmt.executeUpdate();

    Statement stmt = conn.createStatement();
View Full Code Here

    cstmt.setObject(1,bytearr,java.sql.Types.LONGVARBINARY);
    System.out.println("execute the procedure with LONGVARBINARY");
    cstmt.executeUpdate();
    cstmt.setObject(1,bytearr,java.sql.Types.BLOB);
    System.out.println("execute the procedure with BLOB");
    cstmt.executeUpdate();

    Statement stmt = conn.createStatement();
    String Longvarbinary_Query="Select lvbc from Longvarbinary_Tab";
    System.out.println(Longvarbinary_Query);
    ResultSet rs=stmt.executeQuery(Longvarbinary_Query);
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.