org.apache.derbyTesting.junit .BaseJDBCTestCase org.apache.derbyTesting.functionTests.tests.jdbc4 .PreparedStatementTest PreparedStatementTest public class PreparedStatementTest extends BaseJDBCTestCase (Code) This class is used to test JDBC4 specific methods in the PreparedStatement(s)
object.
A number of methods and variables are in place to aid the writing of tests:
setBinaryStreamOnBlob
setAsciiStream
key - an id. One is generated each time setUp is run.
reqeustKey() - generate a new unique id.
psInsertX - prepared statements for insert.
psFetchX - prepared statements for fetching values.
For table creation, see the suite
-method.
PreparedStatementTest public PreparedStatementTest(String name)(Code) Create a test with the given name.
Parameters: name - name of the test.
suite public static Test suite()(Code)
testBlobExceptionDoesNotRollbackOtherStatements public void testBlobExceptionDoesNotRollbackOtherStatements() throws IOException , SQLException (Code)
testExceptionPathMultiplePages_bs public void testExceptionPathMultiplePages_bs() throws SQLException (Code)
testExceptionPathOnePage_bs public void testExceptionPathOnePage_bs() throws SQLException (Code)
testIsNotWrapperForCallableStatement public void testIsNotWrapperForCallableStatement() throws SQLException (Code)
testIsNotWrapperForResultSet public void testIsNotWrapperForResultSet() throws SQLException (Code)
testIsWrapperForPreparedStatement public void testIsWrapperForPreparedStatement() throws SQLException (Code)
testIsWrapperForStatement public void testIsWrapperForStatement() throws SQLException (Code)
testSetAsciiStream public void testSetAsciiStream() throws Exception (Code) Tests the PreparedStatement interface method setAsciiStream
throws: SQLException -
testSetAsciiStreamLengthLessOnClobTooLong public void testSetAsciiStreamLengthLessOnClobTooLong()(Code)
testSetAsciiStreamLengthLessOnClobTooLongTruncate public void testSetAsciiStreamLengthLessOnClobTooLongTruncate() throws SQLException (Code)
testSetAsciiStreamLengthlessOnLongVarCharDontTruncate public void testSetAsciiStreamLengthlessOnLongVarCharDontTruncate()(Code)
testSetAsciiStreamLengthlessOnLongVarCharTooLong public void testSetAsciiStreamLengthlessOnLongVarCharTooLong()(Code)
testSetBinaryStream public void testSetBinaryStream() throws Exception (Code) Tests the PreparedStatement interface method setBinaryStream
throws: SQLException -
testSetBinaryStreamLengthLessOnBlobTooLong public void testSetBinaryStreamLengthLessOnBlobTooLong()(Code)
testSetBlobLengthless public void testSetBlobLengthless() throws IOException , SQLException (Code) Insert Blob
without specifying length and read it back
for verification.
Beacuse we don't yet support Connection.createBlob
in the
client driver, we must first insert data into the database and read back
a Blob
object. This object is then inserted into the
database again.
testSetCharacterStream public void testSetCharacterStream() throws Exception (Code) Tests the PreparedStatement interface method setCharacterStream
throws: SQLException -
testSetClobLengthless public void testSetClobLengthless() throws IOException , SQLException (Code) Insert Clob
without specifying length and read it back
for verification.
Beacuse we don't yet support Connection.createClob
in the
client driver, we must first insert data into the database and read back
a Clob
object. This object is then inserted into the
database again.
testSetNCharacterStream public void testSetNCharacterStream() throws SQLException (Code) Tests the setNCharacterStream method of the PreparedStatement interface
throws: SQLException - upon any failure that occurs in the call to the method.
testSetNCharacterStreamLengthlessNotImplemented public void testSetNCharacterStreamLengthlessNotImplemented() throws SQLException (Code)
testSetNClob1 public void testSetNClob1() throws SQLException (Code) Tests the setNClob method of the PreparedStatement interface
throws: SQLException - upon any failure that occurs in the call to the method.
testSetNClob2 public void testSetNClob2() throws SQLException (Code) Tests the setNClob method of the PreparedStatement interface
throws: SQLException - upon any failure that occurs in the call to the method.
testSetNClobLengthlessNotImplemented public void testSetNClobLengthlessNotImplemented() throws SQLException (Code)
testSetNString public void testSetNString() throws SQLException (Code) Tests the setNString method of the PreparedStatement interface
throws: SQLException - upon any failure that occurs in the call to the method.
testSetPoolable public void testSetPoolable() throws SQLException (Code) Tests the PreparedStatement interface method setPoolable
throws: SQLException -
testSetRowId public void testSetRowId() throws SQLException (Code) Tests the setRowId method of the PreparedStatement interface
throws: SQLException - upon any failure that occurs in the call to the method.
testSetSQLXML public void testSetSQLXML() throws SQLException (Code) Tests the setSQLXML method of the PreparedStatement interface
throws: SQLException - upon any failure that occurs in the call to the method.
testUnwrapCallableStatement public void testUnwrapCallableStatement()(Code)
testUnwrapPreparedStatement public void testUnwrapPreparedStatement() throws SQLException (Code)
testUnwrapResultSet public void testUnwrapResultSet()(Code)
Methods inherited from org.apache.derbyTesting.junit.BaseJDBCTestCase public void assertCompileError(String sqlState, String query)(Code) (Java Doc) public static void assertEquals(Blob b1, Blob b2) throws IOException , SQLException (Code) (Java Doc) public static void assertEquals(Clob c1, Clob c2) throws IOException , SQLException (Code) (Java Doc) public static void assertSQLState(String message, String expected, SQLException exception)(Code) (Java Doc) public static void assertSQLState(String expected, SQLException exception)(Code) (Java Doc) public void commit() throws SQLException (Code) (Java Doc) public Statement createStatement() throws SQLException (Code) (Java Doc) public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException (Code) (Java Doc) public Connection getConnection() throws SQLException (Code) (Java Doc) public Connection getConnection(String databaseName, String connAttrs) throws SQLException (Code) (Java Doc) public Connection getDefaultConnection(String connAttrs) throws SQLException (Code) (Java Doc) protected void initializeConnection(Connection conn) throws SQLException (Code) (Java Doc) public Connection openConnection(String databaseName) throws SQLException (Code) (Java Doc) public Connection openDefaultConnection() throws SQLException (Code) (Java Doc) public CallableStatement prepareCall(String sql) throws SQLException (Code) (Java Doc) public PreparedStatement prepareStatement(String sql) throws SQLException (Code) (Java Doc) public void rollback() throws SQLException (Code) (Java Doc) public int runSQLCommands(String sqlCommands) throws UnsupportedEncodingException , SQLException (Code) (Java Doc) public int runScript(InputStream script, String encoding) throws UnsupportedEncodingException , SQLException (Code) (Java Doc) protected void tearDown() throws java.lang.Exception (Code) (Java Doc) public static boolean usingDerbyNet()(Code) (Java Doc) public static boolean usingDerbyNetClient()(Code) (Java Doc) public static boolean usingEmbedded()(Code) (Java Doc)