Package java.sql

Examples of java.sql.CallableStatement.executeQuery()


            st.setString(3, "this is a <a");
            st.setString(4, "unused");
            st.setLong(5, 1L);
            // st.registerOutParameter(1, Types.INTEGER);
            st.registerOutParameter(1, Types.CLOB);
            ResultSet rs = st.executeQuery();
            // int ret = st.getInt(1);
            Clob clob = st.getClob(1);
            long len = clob.length();
            byte[] buf = new byte[(int)len];
            clob.getAsciiStream().read(buf);
View Full Code Here


            st.setString(3, "<this is a");
            st.setString(4, "unused");
            st.setLong(5, 1L);
            // st.registerOutParameter(1, Types.INTEGER);
            st.registerOutParameter(1, Types.CLOB);
            ResultSet rs = st.executeQuery();
            // int ret = st.getInt(1);
            Clob clob = st.getClob(1);
            long len = clob.length();
            byte[] buf = new byte[(int)len];
            clob.getAsciiStream().read(buf);
View Full Code Here

            st.setString(3, "a<this is a");
            st.setString(4, "unused");
            st.setLong(5, 1L);
            // st.registerOutParameter(1, Types.INTEGER);
            st.registerOutParameter(1, Types.CLOB);
            ResultSet rs = st.executeQuery();
            // int ret = st.getInt(1);
            Clob clob = st.getClob(1);
            long len = clob.length();
            byte[] buf = new byte[(int)len];
            clob.getAsciiStream().read(buf);
View Full Code Here

                String tmp = new String("Haloooooo");
                st.setBytes(3, tmp.getBytes());
                st.setString(4, "name");
                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

                String tmp = new String("Haloooooo");
                st.setString(3, tmp);
                st.setString(4, "name");
                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

            try {
               CallableStatement st = conn.prepareCall(sql);
               st.setInt(2, 2);
               st.setLong(3, 1000L);
               st.registerOutParameter(1, Types.VARCHAR);
               ResultSet rs = st.executeQuery();
               String ret = st.getString(1);
               rs.close();
               st.close();
               log.fine("The return value of the query '" + sql + "' is '" + ret + "'");
               // no assert here, just testing for exceptions
View Full Code Here

                  in[i] = (byte)i;
               }
               st.setBytes(2, in);
               // st.registerOutParameter(1, Types.VARCHAR); // worked for oracle 10
               st.registerOutParameter(1, Types.CLOB);
               ResultSet rs = st.executeQuery();
               // String ret = st.getString(1);
               Clob clob = st.getClob(1);
               long len = clob.length();
               byte[] buf = new byte[(int)len];
               clob.getAsciiStream().read(buf);
View Full Code Here

               CallableStatement st = conn.prepareCall(sql);

               String test = "this is a simple base64 encoding test for clobs";
               st.setString(2, test);
               st.registerOutParameter(1, Types.CLOB);
               ResultSet rs = st.executeQuery();
               // String ret = st.getString(1);
               Clob clob = st.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_BLOB");
                st.setBytes(3, in);
                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

               "SpecificDefault.incrementReplKey: the DB connection is null");
      CallableStatement st = null;
      try {
         st = conn.prepareCall("{? = call " + this.replPrefix + "increment()}");
         st.registerOutParameter(1, Types.INTEGER);
         st.executeQuery();
         long ret = st.getLong(1);
         return ret;
      } finally {
         try {
            if (st != null)
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.