public class JDBC4FromJDBC3DataSourceTest extends BaseJDBCTestCase
This test ensures that when a JDBC 4 application instantiates a JDBC 3 data source, that data source will return JDBC 4 connections even though the data source itself is not a JDBC 4 object.
Note that after DERBY-5868 and DERBY-5880, all the data sources (except EmbeddedSimpleDataSource for JSR-169) implement all JDBC 4.0 methods.
Neither the client nor the embedded variants of the JDBC 3 data sources implement the full JDBC 4.1 interface.
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
JDBC4FromJDBC3DataSourceTest(java.lang.String name)
Create a test with the given name.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
assertNonJDBC4DataSource(javax.sql.DataSource ds)
Make sure that the received DataSource is *not* a JDBC 4
data source, since that would defeat the whole purpose
of this test.
|
private void |
checkJDBC4Interface(javax.sql.PooledConnection pc)
Make sure that the received PooledConnection, which we assume came
from a JDBC 3 data source, is nonetheless a JDBC 4 object.
|
static junit.framework.Test |
suite()
Return suite with all tests of the class.
|
void |
testPooledConnection()
Test that a JDBC 3 data source returns a JDBC 4 PooledConnection
when running with a JDBC 4 JDK.
|
void |
testXAConnection()
Test that a JDBC 3 data source returns a JDBC 4 XAConnection
when running with a JDBC 4 JDK.
|
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, 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, tearDown, 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, setUp, toStringpublic JDBC4FromJDBC3DataSourceTest(java.lang.String name)
name - name of the test.public static junit.framework.Test suite()
public void testPooledConnection()
throws java.lang.Exception
java.lang.Exceptionpublic void testXAConnection()
throws java.lang.Exception
java.lang.Exceptionprivate void assertNonJDBC4DataSource(javax.sql.DataSource ds)
throws java.sql.SQLException
java.sql.SQLExceptionprivate void checkJDBC4Interface(javax.sql.PooledConnection pc)
throws java.lang.Exception
java.lang.ExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.