Class DerbyConnectionProvider
- java.lang.Object
-
- com.ibm.fhir.database.utils.derby.DerbyConnectionProvider
-
- All Implemented Interfaces:
IConnectionProvider
public class DerbyConnectionProvider extends java.lang.Object implements IConnectionProvider
AnIConnectionProvider
wrapper around DerbyMaster
-
-
Constructor Summary
Constructors Constructor Description DerbyConnectionProvider(DerbyMaster derby, java.lang.String schemaName)
Wrap the derby database
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commitTransaction()
Commit the current transaction if there's an actual connection associated with this thread (i.e.void
describe(java.lang.String arg0, java.lang.StringBuilder arg1, java.lang.String arg2)
Describe self, for writing configuration information to log file for test record purposesjava.sql.Connection
getConnection()
Obtain a new connection to a data-source which this provider has been configured for.IDatabaseTranslator
getTranslator()
Get the translator associated with this connection provider.void
rollbackTransaction()
Roll back the transaction for the connection associated with this thread, if one exists-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.fhir.database.utils.api.IConnectionProvider
getPoolSize
-
-
-
-
Constructor Detail
-
DerbyConnectionProvider
public DerbyConnectionProvider(DerbyMaster derby, java.lang.String schemaName)
Wrap the derby database- Parameters:
derby
- the Derby database instance to wrap and provide connections forthe
- schema name to set as current on each connection, or null to not set the schema
-
-
Method Detail
-
commitTransaction
public void commitTransaction() throws java.sql.SQLException
Description copied from interface:IConnectionProvider
Commit the current transaction if there's an actual connection associated with this thread (i.e. if getConnection() has been called at least once), otherwise do nothing.- Specified by:
commitTransaction
in interfaceIConnectionProvider
- Throws:
java.sql.SQLException
-
describe
public void describe(java.lang.String arg0, java.lang.StringBuilder arg1, java.lang.String arg2)
Description copied from interface:IConnectionProvider
Describe self, for writing configuration information to log file for test record purposes- Specified by:
describe
in interfaceIConnectionProvider
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLException
Description copied from interface:IConnectionProvider
Obtain a new connection to a data-source which this provider has been configured for.- Specified by:
getConnection
in interfaceIConnectionProvider
- Returns:
- Throws:
java.sql.SQLException
-
getTranslator
public IDatabaseTranslator getTranslator()
Description copied from interface:IConnectionProvider
Get the translator associated with this connection provider. Supports interpretation of SQLExceptions and the ability to tweak SQL statements to handle differences between DB2 and Derby- Specified by:
getTranslator
in interfaceIConnectionProvider
- Returns:
-
rollbackTransaction
public void rollbackTransaction() throws java.sql.SQLException
Description copied from interface:IConnectionProvider
Roll back the transaction for the connection associated with this thread, if one exists- Specified by:
rollbackTransaction
in interfaceIConnectionProvider
- Throws:
java.sql.SQLException
-
-