| org.apache.derbyTesting.junit.BaseJDBCTestCase org.apache.derbyTesting.functionTests.tests.jdbcapi.ResultSetCloseTest
ResultSetCloseTest | public class ResultSetCloseTest extends BaseJDBCTestCase (Code) | | This class is used to test the fix for DERBY-694.
A brief description of DERBY-694 (Got from the description in JIRA)
1) Autocommit off.
2) Have two prepared statements, calling executeQuery() on both
3) Gives two result sets. Can fetch data from both with next().
4) If one statement gets an exception (say, caused by a division by zero)
5) not only this statement's result set is closed, but also the other open
resultset. This happens with the client driver, whereas in embedded mode,
the other result set is unaffected by the exception in the first result set
(as it should be).
|
Method Summary | |
public void | setUp() Create the tables and the Connection and PreparedStatements that will
be used in this test. | public static Test | suite() Create test suite for this test. | public void | testResultSetDoesNotClose() Test that the occurence of the exception in one of the PreparedStatements
does not result in the closure of the ResultSet associated with the other
Prepared Statements.
STEPS :
1) Execute the first PreparedStatement. |
ResultSetCloseTest | public ResultSetCloseTest(String name)(Code) | | Create the test with the given name.
Parameters: name - name of the test. |
setUp | public void setUp() throws SQLException(Code) | | Create the tables and the Connection and PreparedStatements that will
be used in this test.
|
suite | public static Test suite()(Code) | | Create test suite for this test.
|
testResultSetDoesNotClose | public void testResultSetDoesNotClose() throws SQLException(Code) | | Test that the occurence of the exception in one of the PreparedStatements
does not result in the closure of the ResultSet associated with the other
Prepared Statements.
STEPS :
1) Execute the first PreparedStatement. This should not cause any
SQLException.
2) Now execute the second PreparedStatement. This causes
the expected Divide by zero exception.
3) Now access the first resultset again to ensure this is still open.
|
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)
|
|
|