public class HoldCursorTest extends BaseJDBCTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
HoldCursorTest(java.lang.String name)
Public constructor required for running test as standalone JUnit.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
assertGetIntEquals(int position,
int expected,
java.sql.ResultSet rs)
Perform getInt(position) with expected error
|
void |
assertIsolationError(java.lang.String sqlState,
int level)
Assert that the changing isolation throws
an SQLException with the expected state.
|
private static junit.framework.Test |
baseSuite(boolean embeddedMode) |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Utility method to create a Statement using the connection
returned by getConnection.
|
void |
setHoldability(int holdability)
Utility method to set Holdability
|
void |
setTransactionIsolation(int level)
Utility method to set Transaction Isolation
|
protected void |
setUp()
Set the fixture up with tables and insert rows .
|
void |
StatementsInProcedure(int holdability)
test holdability of statements in procedures
|
void |
StatementsInProcedureTest() |
static junit.framework.Test |
suite()
Create a suite of tests.
|
protected void |
tearDown()
Drop tables for clean up
|
void |
testCloseCursor()
Test for drop table after closing the cursor
|
void |
testDropTable()
Test that drop table cannot be performed when there is an open
cursor on that table.
|
void |
testHoldabilityOverCommit()
set connection holdability and test holdability of statements inside and outside procedures
test that holdability of statements always overrides holdability of connection
|
void |
testHoldCursorOnMultiTableQuery()
test cursor holdability after commit on multi table query
|
void |
testIsolationLevelChange()
Test Chaging isolation levels with and without held curosors
|
static void |
testProc(java.sql.ResultSet[] rs1,
java.sql.ResultSet[] rs2)
Java method for stored procedure
|
void |
testStatements(int holdability)
test holdability of statements outside procedures
|
assertCallError, assertCheckTable, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, dropTable, dropTable, dropView, dropView, emptyStatementCache, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbeddedalarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isJava8, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemProperty, sleep, sleepAtLeastOneTick, traceitassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, toStringpublic HoldCursorTest(java.lang.String name)
public static junit.framework.Test suite()
private static junit.framework.Test baseSuite(boolean embeddedMode)
protected void setUp()
throws java.sql.SQLException
setUp in class junit.framework.TestCasejava.sql.SQLExceptionprotected void tearDown()
throws java.lang.Exception
tearDown in class BaseJDBCTestCasejava.lang.Exceptionpublic void testHoldCursorOnMultiTableQuery()
throws java.lang.Exception
java.lang.Exceptionpublic void testIsolationLevelChange()
throws java.lang.Exception
java.lang.Exceptionpublic void testDropTable()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testHoldabilityOverCommit()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void StatementsInProcedureTest()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testStatements(int holdability)
throws java.sql.SQLException
holdability - java.sql.SQLExceptionpublic void StatementsInProcedure(int holdability)
throws java.sql.SQLException
holdability - java.sql.SQLExceptionpublic void testCloseCursor()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void assertIsolationError(java.lang.String sqlState,
int level)
sqlState - level - public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
createStatement in class BaseJDBCTestCaseresultSetType - resultSetConcurrency - resultSetHoldability - java.sql.SQLExceptionpublic void setTransactionIsolation(int level)
throws java.sql.SQLException
level - java.sql.SQLExceptionpublic void setHoldability(int holdability)
throws java.sql.SQLException
holdability - java.sql.SQLExceptionpublic static void assertGetIntEquals(int position,
int expected,
java.sql.ResultSet rs)
position - expected - rs - public static void testProc(java.sql.ResultSet[] rs1,
java.sql.ResultSet[] rs2)
throws java.lang.Exception
rs1 - rs2 - java.lang.ExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.