Package org.apache.derbyTesting.functionTests.util

Examples of org.apache.derbyTesting.functionTests.util.TestInputStream


        int size = rs.getInt("LENGTH");
        println("VerifyBlob");
        verifyBlob(val, size, rs.getBlob("DATA"));
       
        println("UpdateBlob");
        final TestInputStream newStream = new TestInputStream(newSize, newVal);
       
        rs.updateInt("VAL", newVal);
        rs.updateInt("LENGTH", newSize);
        rs.updateBinaryStream("DATA", newStream, newSize);
        rs.updateRow();
View Full Code Here


             " SET val=?, length = ?, data = ? WHERE CURRENT OF " +
             rs.getCursorName());
       
        println("UpdateBlob");
       
        final TestInputStream newStream = new TestInputStream(newSize, newVal);
       
        preparedStatement.setInt(1, newVal);
        preparedStatement.setInt(2, newSize);
        preparedStatement.setBinaryStream(3, newStream, newSize);
        preparedStatement.executeUpdate();
View Full Code Here

        st.executeUpdate("create table clob_tab(c1 int,clob_col clob(10K))");
        commit();
       
        PreparedStatement pSt =
                prepareStatement("INSERT INTO clob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert fails(size>10K)
        pSt.setInt(1, val);
        pSt.setAsciiStream(2, stream, size);
        assertStatementError("XJ001", pSt);
        pSt.close();
       
        rollback();
       
        st.executeUpdate("ALTER TABLE clob_tab ALTER COLUMN "
                +"clob_col SET DATA TYPE clob(20K)");
       
        pSt = prepareStatement("INSERT INTO clob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert succeed (maximum blob size not increased to 20K)
        pSt.setInt(1, val);
        pSt.setAsciiStream(2, stream, size);
        pSt.executeUpdate();
        pSt.close();
       
       
        //increase the maximum size of the blob       
       
        st.executeUpdate("CREATE TABLE blob_tab ( C1 INTEGER," +
                                "blob_col BLOB(10K) NOT NULL)");
       
        commit();
       
        pSt = prepareStatement("INSERT INTO blob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert fails(size>10K)
        pSt.setInt(1, val);
        pSt.setBinaryStream(2, stream, size);
        assertStatementError("22001", pSt);
        pSt.close();
       
        rollback();
       
        st.executeUpdate("ALTER TABLE blob_tab ALTER COLUMN "
                +"blob_col SET DATA TYPE blob(20K)")
       
        pSt = prepareStatement("INSERT INTO blob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert succeed (maximum blob size not increased to 20K)
        pSt.setInt(1, val);
        pSt.setBinaryStream(2, stream, size);
        pSt.executeUpdate();
View Full Code Here

              
        st.executeUpdate("create table clob_tab(c1 int,clob_col clob(10K))");
        conn.commit();
       
        pSt=conn.prepareStatement("INSERT INTO clob_tab values (?,?)");  
        stream = new TestInputStream(size, val);
       
        //this insert fails(size>10K)
        pSt.setInt(1, val);
        pSt.setAsciiStream(2, stream, size);
        assertStatementError("XJ001", pSt);
        pSt.close();
       
        conn.rollback();
       
        st.executeUpdate("ALTER TABLE clob_tab ALTER COLUMN "
                +"clob_col SET DATA TYPE clob(20K)");
       
        pSt=conn.prepareStatement("INSERT INTO clob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert succeed (maximum blob size not increased to 20K)
        pSt.setInt(1, val);
        pSt.setAsciiStream(2, stream, size);
        pSt.executeUpdate();
        pSt.close();
       
       
        //increase the maximum size of the blob       
       
        st.executeUpdate("CREATE TABLE blob_tab ( C1 INTEGER," +
                                "blob_col BLOB(10K) NOT NULL)");
       
        conn.commit();
       
        pSt=conn.prepareStatement("INSERT INTO blob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert fails(size>10K)
        pSt.setInt(1, val);
        pSt.setBinaryStream(2, stream, size);
        assertStatementError("22001", pSt);
        pSt.close();
       
        conn.rollback();
       
        st.executeUpdate("ALTER TABLE blob_tab ALTER COLUMN "
                +"blob_col SET DATA TYPE blob(20K)")
       
        pSt=conn.prepareStatement("INSERT INTO blob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert succeed (maximum blob size not increased to 20K)
        pSt.setInt(1, val);
        pSt.setBinaryStream(2, stream, size);
        pSt.executeUpdate();
View Full Code Here

            ("INSERT INTO " + tableName + "(val, length, data) VALUES (?,?, ?)");
       
        // Insert 10 records with size of 1MB
        for (int i = 0; i < regularBlobs; i++) {
            final int val = i;
            final InputStream stream = new TestInputStream(size, val);
            preparedStatement.setInt(1, val);
            preparedStatement.setInt(2, size);
            preparedStatement.setBinaryStream(3, stream, size);
            preparedStatement.executeUpdate();
        }
       
        // Insert 1 record with size of 64 MB
        BaseJDBCTestCase.println("Insert BLOB with size = " + bigSize);
        preparedStatement.setInt(1, bigVal);
        preparedStatement.setInt(2, bigSize);
        final InputStream stream = new TestInputStream(bigSize, bigVal);
        preparedStatement.setBinaryStream(3, stream, bigSize);
       
        BaseJDBCTestCase.println("Execute update");
        preparedStatement.executeUpdate();
        preparedStatement.close();
View Full Code Here

              
        st.executeUpdate("create table clob_tab(c1 int,clob_col clob(10K))");
        conn.commit();
       
        pSt=conn.prepareStatement("INSERT INTO clob_tab values (?,?)");  
        stream = new TestInputStream(size, val);
       
        //this insert fails(size>10K)
        pSt.setInt(1, val);
        pSt.setAsciiStream(2, stream, size);
        assertStatementError("XJ001", pSt);
        pSt.close();
       
        conn.rollback();
       
        st.executeUpdate("ALTER TABLE clob_tab ALTER COLUMN "
                +"clob_col SET DATA TYPE clob(20K)");
       
        pSt=conn.prepareStatement("INSERT INTO clob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert succeed (maximum blob size not increased to 20K)
        pSt.setInt(1, val);
        pSt.setAsciiStream(2, stream, size);
        pSt.executeUpdate();
        pSt.close();
       
       
        //increase the maximum size of the blob       
       
        st.executeUpdate("CREATE TABLE blob_tab ( C1 INTEGER," +
                                "blob_col BLOB(10K) NOT NULL)");
       
        conn.commit();
       
        pSt=conn.prepareStatement("INSERT INTO blob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert fails(size>10K)
        pSt.setInt(1, val);
        pSt.setBinaryStream(2, stream, size);
        assertStatementError("22001", pSt);
        pSt.close();
       
        conn.rollback();
       
        st.executeUpdate("ALTER TABLE blob_tab ALTER COLUMN "
                +"blob_col SET DATA TYPE blob(20K)")
       
        pSt=conn.prepareStatement("INSERT INTO blob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert succeed (maximum blob size not increased to 20K)
        pSt.setInt(1, val);
        pSt.setBinaryStream(2, stream, size);
        pSt.executeUpdate();
View Full Code Here

        int size = rs.getInt("LENGTH");
        println("VerifyBlob");
        verifyBlob(val, size, rs.getBlob("DATA"));
       
        println("UpdateBlob");
        final TestInputStream newStream = new TestInputStream(newSize, newVal);
       
        rs.updateInt("VAL", newVal);
        rs.updateInt("LENGTH", newSize);
        rs.updateBinaryStream("DATA", newStream, newSize);
        rs.updateRow();
View Full Code Here

             " SET val=?, length = ?, data = ? WHERE CURRENT OF " +
             rs.getCursorName());
       
        println("UpdateBlob");
       
        final TestInputStream newStream = new TestInputStream(newSize, newVal);
       
        preparedStatement.setInt(1, newVal);
        preparedStatement.setInt(2, newSize);
        preparedStatement.setBinaryStream(3, newStream, newSize);
        preparedStatement.executeUpdate();
View Full Code Here

        st.executeUpdate("create table clob_tab(c1 int,clob_col clob(10K))");
        commit();
       
        PreparedStatement pSt =
                prepareStatement("INSERT INTO clob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert fails(size>10K)
        pSt.setInt(1, val);
        pSt.setAsciiStream(2, stream, size);
        assertStatementError("XJ001", pSt);
        pSt.close();
       
        rollback();
       
        st.executeUpdate("ALTER TABLE clob_tab ALTER COLUMN "
                +"clob_col SET DATA TYPE clob(20K)");
       
        pSt = prepareStatement("INSERT INTO clob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert succeed (maximum blob size not increased to 20K)
        pSt.setInt(1, val);
        pSt.setAsciiStream(2, stream, size);
        pSt.executeUpdate();
        pSt.close();
       
       
        //increase the maximum size of the blob       
       
        st.executeUpdate("CREATE TABLE blob_tab ( C1 INTEGER," +
                                "blob_col BLOB(10K) NOT NULL)");
       
        commit();
       
        pSt = prepareStatement("INSERT INTO blob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert fails(size>10K)
        pSt.setInt(1, val);
        pSt.setBinaryStream(2, stream, size);
        assertStatementError("22001", pSt);
        pSt.close();
       
        rollback();
       
        st.executeUpdate("ALTER TABLE blob_tab ALTER COLUMN "
                +"blob_col SET DATA TYPE blob(20K)")
       
        pSt = prepareStatement("INSERT INTO blob_tab values (?,?)");
        stream = new TestInputStream(size, val);
       
        //this insert succeed (maximum blob size not increased to 20K)
        pSt.setInt(1, val);
        pSt.setBinaryStream(2, stream, size);
        pSt.executeUpdate();
View Full Code Here

            ("INSERT INTO " + tableName + "(val, length, data) VALUES (?,?, ?)");
       
        // Insert 10 records with size of 1MB
        for (int i = 0; i < regularBlobs; i++) {
            final int val = i;
            final InputStream stream = new TestInputStream(size, val);
            preparedStatement.setInt(1, val);
            preparedStatement.setInt(2, size);
            preparedStatement.setBinaryStream(3, stream, size);
            preparedStatement.executeUpdate();
        }
       
        // Insert 1 record with size of 64 MB
        BaseJDBCTestCase.println("Insert BLOB with size = " + bigSize);
        preparedStatement.setInt(1, bigVal);
        preparedStatement.setInt(2, bigSize);
        final InputStream stream = new TestInputStream(bigSize, bigVal);
        preparedStatement.setBinaryStream(3, stream, bigSize);
       
        BaseJDBCTestCase.println("Execute update");
        preparedStatement.executeUpdate();
        preparedStatement.close();
View Full Code Here

TOP

Related Classes of org.apache.derbyTesting.functionTests.util.TestInputStream

Copyright © 2018 www.massapicom. 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.