Package java.sql

Examples of java.sql.CallableStatement.executeQuery()


            em.getTransaction().commit();

            cs = connection.prepareCall("{call GetSemanticCourses(?)}");
            cs.setInt(1, userID);
            ResultSet rs = cs.executeQuery();

            courseList = new ArrayList<Integer>();
            while (rs.next()) {
                String courseid = rs.getString("courseid");
                courseList.add(new Integer(Integer.parseInt(courseid)));
View Full Code Here


    {
        CallableStatement cs =
            prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
        cs.setInt(1, 0);
        try {
            cs.executeQuery();
            fail("executeQuery() didn't fail.");
        } catch (SQLException sqle) {
            assertNoResultSetFromExecuteQuery(sqle);
        }
    }
View Full Code Here

        throws SQLException
    {
        CallableStatement cs =
            prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
        cs.setInt(1, 1);
        ResultSet rs = cs.executeQuery();
        assertNotNull("executeQuery() returned null.", rs);
        assertSame(cs, rs.getStatement());
        JDBC.assertDrainResultsHasData(rs);
    }
View Full Code Here

    {
        CallableStatement cs =
            prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
        cs.setInt(1, 2);
        try {
            cs.executeQuery();
            fail("executeQuery() didn't fail.");
        } catch (SQLException sqle) {
            assertMultipleResultsFromExecuteQuery(sqle);
        }
    }
View Full Code Here

      System.out.println("Standard parsing/execution: " + elapsedTime
          + " ms");

      storedProc = this.conn.prepareCall("{call testSpParse(?)}");
      storedProc.setString(1, "abc");
      this.rs = storedProc.executeQuery();

      assertTrue(this.rs.next());
      assertTrue(this.rs.getInt(1) == 1);

      Properties props = new Properties();
View Full Code Here

      System.out.println("Cached parse stage: " + elapsedTime + " ms");

      storedProc = cachedSpConn.prepareCall("{call testSpParse(?)}");
      storedProc.setString(1, "abc");
      this.rs = storedProc.executeQuery();

      assertTrue(this.rs.next());
      assertTrue(this.rs.getInt(1) == 1);

    }
View Full Code Here

    {
        CallableStatement cs =
            prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
        cs.setInt(1, 0);
        try {
            cs.executeQuery();
            fail("executeQuery() didn't fail.");
        } catch (SQLException sqle) {
            assertNoResultSetFromExecuteQuery(sqle);
        }
    }
View Full Code Here

        throws SQLException
    {
        CallableStatement cs =
            prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
        cs.setInt(1, 1);
        ResultSet rs = cs.executeQuery();
        assertNotNull("executeQuery() returned null.", rs);
        assertSame(cs, rs.getStatement());
        JDBC.assertDrainResultsHasData(rs);
    }
View Full Code Here

    {
        CallableStatement cs =
            prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
        cs.setInt(1, 2);
        try {
            cs.executeQuery();
            fail("executeQuery() didn't fail.");
        } catch (SQLException sqle) {
            assertMultipleResultsFromExecuteQuery(sqle);
        }
    }
View Full Code Here

    {
        createTableT1();
        CallableStatement callStmt = prepareCall(
                "select * from t1",
                ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
        ResultSet rs = callStmt.executeQuery();
        assertEquals("FAIL - wrong result set type",
                ResultSet.TYPE_FORWARD_ONLY, callStmt.getResultSetType());
        assertEquals("FAIL - wrong result set concurrency",
                ResultSet.CONCUR_UPDATABLE, callStmt.getResultSetConcurrency());
        assertTrue("FAIL - statement should return a row", rs.next());
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.