Package java.sql

Examples of java.sql.CallableStatement.executeQuery()


    try
    {
      stmt = c.prepareCall("{ call sp_helpindex ? }");
      stmt.setString(1, oi.getSimpleName());
      rs = stmt.executeQuery();
    }
    catch (java.sql.SQLException e)
    {
      s_log.error("getTableConstraints: Unexpected exception - " + e.getMessage(), e);
      // no indexes, i guess.
View Full Code Here


    try
    {
      stmt = c.prepareCall("{ call sp_helptrigger ? }");
      stmt.setString(1, oi.getSimpleName());
      rs = stmt.executeQuery();
    }
    catch (java.sql.SQLException e)
    {
      s_log.error("generateCreateTriggersScript: Unexpected exception - " + e.getMessage(), e);
      // no triggers, i guess.
View Full Code Here

    try
    {
      stmt = c.prepareCall("{ call sp_helprotect ? }");
      stmt.setString(1, MssqlIntrospector.getFixedVersionedObjectName(oi.getSimpleName()));
      rs = stmt.executeQuery();
    }
    catch (java.sql.SQLException e)
    {
      s_log.error("generatePermissionsScript: Unexpected exception - " + e.getMessage(), e);
      // no permissions, i guess.
View Full Code Here

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

        throws SQLException
    {
        CallableStatement cs =
            getConnection().prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
        cs.setInt(1, 1);
        ResultSet rs = cs.executeQuery();
        assertNotNull("executeQuery() returned null.", rs);
        assertTrue("Result set has no data.", rs.next());
        rs.close();
        cs.close();
    }
View Full Code Here

    {
        CallableStatement cs =
            getConnection().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

            em.getTransaction().commit();

            cs = connection.prepareCall("{call GetSearchedCourses(?, ?)}");
            cs.setString(1, searchKey);
            cs.setInt(2, 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

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

            while (rs.next()) {
                String courseid = rs.getString("courseid");
                System.out.println("courseID" + ": " + courseid);
            }
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.