Package java.sql

Examples of java.sql.Blob.position()


                    TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
                }
                // 0 or negative position value
                try
                {
                    blob.position(new byte[0],-4000);
                }
            catch (SQLException e)
                {
              TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
            }
View Full Code Here


            }
                // null pattern
                try
                {
          // bug 5247 in network server (NPE)
                    blob.position((byte[]) null,5);
                }
            catch (SQLException e)
                {
              TestUtil.dumpSQLExceptions(e,isNullSearchPattern(e));
            }
View Full Code Here

              TestUtil.dumpSQLExceptions(e,isNullSearchPattern(e));
            }
                // 0 or negative position value
                try
                {
                    blob.position(blob,-42);
                }
            catch (SQLException e)
                {
              TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
            }
View Full Code Here

              TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
            }
                // null pattern
                try
                {
                    blob.position((Blob) null,5);
                }
            catch (SQLException e)
                {
              TestUtil.dumpSQLExceptions(e,isNullSearchPattern(e));
            }
View Full Code Here

            {
          TestUtil.dumpSQLExceptions(e);
        }
            try
            {
                blob.position("foo".getBytes("US-ASCII"),2);
            }
            catch (SQLException e)
            {
          TestUtil.dumpSQLExceptions(e);
        }
View Full Code Here

            {
          TestUtil.dumpSQLExceptions(e);
        }
            try
            {
                blob.position(blob,2);
            }
            catch (SQLException e)
            {
          TestUtil.dumpSQLExceptions(e);
        }
View Full Code Here

            {
        expectedExceptionForNSOnly (e);
        }
            try
            {
                blob.position("foo".getBytes("US-ASCII"),2);
            }
            catch (SQLException e)
            {
        expectedExceptionForNSOnly (e);
        }
View Full Code Here

            {
        expectedExceptionForNSOnly (e);
        }
            try
            {
                blob.position(blob,2);
            }
            catch (SQLException e)
            {
        expectedExceptionForNSOnly (e);
        }
View Full Code Here

        ps = _conn.prepareStatement(SELECT);
        rs = ps.executeQuery();

        assertTrue(rs.next());
        b = rs.getBlob("DATA");
        long position = b.position(pattern, 1);
        byte[] rspData = b.getBytes(position, pattern.length);
        assertTrue("Request should be the same as the response", Arrays.equals(pattern, rspData));

        rs.close();
        ps.close();
View Full Code Here

        // Select some parts of the Blob, moving backwards.
        assertEquals(100, b.getBytes(32*1024-27, 100).length);
        assertEquals(1029, b.getBytes(19*1024, 1029).length);
        // Compare a fresh stream with the one from the Blob.
        assertEquals(new LoopingAlphabetStream(length), b.getBinaryStream());
        assertEquals(-1, b.position(new byte[] {(byte)'a', (byte)'A'}, 1));
        assertEquals(length, b.length());
        assertFalse(rs.next());
        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.