Package java.sql

Examples of java.sql.CallableStatement.executeQuery()


        call.setString(2, "Hello");
        call.execute();
        call = conn.prepareCall("SELECT * FROM TEST",
                ResultSet.TYPE_FORWARD_ONLY,
                ResultSet.CONCUR_READ_ONLY);
        rs = call.executeQuery();
        rs.next();
        assertEquals(1, rs.getInt(1));
        assertEquals("Hello", rs.getString(2));
        assertFalse(rs.next());
        call = conn.prepareCall("SELECT * FROM TEST",
View Full Code Here


        assertFalse(rs.next());
        call = conn.prepareCall("SELECT * FROM TEST",
                ResultSet.TYPE_FORWARD_ONLY,
                ResultSet.CONCUR_READ_ONLY,
                ResultSet.HOLD_CURSORS_OVER_COMMIT);
        rs = call.executeQuery();
        rs.next();
        assertEquals(1, rs.getInt(1));
        assertEquals("Hello", rs.getString(2));
        assertFalse(rs.next());
        stat.execute("CREATE ALIAS testCall FOR \"" + getClass().getName() + ".testCall\"");
View Full Code Here

        res = statement.executeQuery(translatedQuery);
      }
      else
      {
        final PreparedStatement pstmt = (PreparedStatement) statement;
        res = pstmt.executeQuery();
      }
    }
    finally
    {
      currentRunningStatement = null;
View Full Code Here

            st.setString(2, "COL2XML");
            st.setString(3, "colValue");
            st.setString(4, "colName");
            st.setLong(5, 1L);
            st.registerOutParameter(1, Types.CLOB);
            ResultSet rs = st.executeQuery();
            Clob clob = st.getClob(1);
            long len = clob.length();
            byte[] buf = new byte[(int)len];
            clob.getAsciiStream().read(buf);
            rs.close();
View Full Code Here

            st.setString(2, "COL2XML");
            st.setString(3, "prova");
            st.setString(4, "test");
            st.setLong(5, 1L);
            st.registerOutParameter(1, Types.CLOB);
            ResultSet rs = st.executeQuery();
            Clob clob = st.getClob(1);
            long len = clob.length();
            byte[] buf = new byte[(int)len];
            clob.getAsciiStream().read(buf);
            rs.close();
View Full Code Here

            st.setString(2, "COL2XML");
            st.setString(3, "<![CDATA[colValue]]>");
            st.setString(4, "colName");
            st.setLong(5, 1L);
            st.registerOutParameter(1, Types.CLOB);
            ResultSet rs = st.executeQuery();
            Clob clob = st.getClob(1);
            long len = clob.length();
            byte[] buf = new byte[(int)len];
            clob.getAsciiStream().read(buf);
            rs.close();
View Full Code Here

            st.setString(2, "COL2XML");
            st.setString(3, "c&lt;olValue");
            st.setString(4, "colName");
            st.setLong(5, 1L);
            st.registerOutParameter(1, Types.CLOB);
            ResultSet rs = st.executeQuery();
            Clob clob = st.getClob(1);
            long len = clob.length();
            byte[] buf = new byte[(int)len];
            clob.getAsciiStream().read(buf);
            rs.close();
View Full Code Here

               // sql = "{? = call nextval('repl_seq')}";
               sql = "{? = call " + this.replPrefix + "increment()}";
               CallableStatement st = conn.prepareCall(sql);
               // st.registerOutParameter(1, Types.BIGINT);
               st.registerOutParameter(1, Types.INTEGER);
               ResultSet rs = st.executeQuery();
               // long ret = st.getLong(1);
               long ret = st.getLong(1);
               rs.close();
               st.close();
               log.fine("The return value of the query '" + sql + "' is '" + ret + "'. The maximum integer value is '" + Integer.MAX_VALUE + "'");
View Full Code Here

            String sqlTopic = null;
            String statementId = "1";
            this.dbSpecific.broadcastStatement(sql, maxResponseEntries, isHighPrio, isMaster, sqlTopic, statementId);
            Statement st = conn.createStatement();
            try {
               ResultSet rs = st.executeQuery("SELECT content FROM " + this.dbHelper.getIdentifier(this.replPrefix + "ITEMS"));
               if (rs.next()) {
                  Clob clob = rs.getClob(1);
                  long len = clob.length();
                  byte[] buf = new byte[(int)len];
                  clob.getAsciiStream().read(buf);
View Full Code Here

               st.setString(2, "BASE64_ENC_CLOB");
               st.setString(3, test);
               st.setString(4, "unused");
               st.setLong(5, 1L); // loop only once
               st.registerOutParameter(1, Types.CLOB);
               ResultSet rs = st.executeQuery();
               Clob clob = st.getClob(1);
               long len = clob.length();
               byte[] buf = new byte[(int)len];
               clob.getAsciiStream().read(buf);
               rs.close();
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.