Package org.frankframework.jdbc
Class JdbcFacade
java.lang.Object
org.frankframework.jndi.JndiBase
org.frankframework.jdbc.JdbcFacade
- All Implemented Interfaces:
HasPhysicalDestination
,IConfigurable
,IConfigurationAware
,INamedObject
,IScopeProvider
,IXAEnabled
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
AbstractJdbcMessageBrowser
,AbstractJdbcSender
,JdbcListener
,Locker
,SimpleJdbcListener
Provides functions for JDBC connections.
N.B. Note on using XA transactions:
If transactions are used, make sure that the database user can access the table SYS.DBA_PENDING_TRANSACTIONS.
If not, transactions present when the server goes down cannot be properly recovered, resulting in exceptions like:
The error code was XAER_RMERR. The exception stack trace follows: javax.transaction.xa.XAException at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:508)
- Since:
- 4.1
- Author:
- Gerrit van Brakel
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Obtains a connection to the datasource.getConnectionWithTimeout
(int timeout) protected DataSource
Deprecated.protected String
protected String
Returns the name and location of the database that this objects operates on.boolean
boolean
indicates implementing object is under transaction control, using XA-transactionsvoid
setAuthAlias
(String authAlias) Authentication alias used to authenticate when connecting to databasevoid
setConnectionsArePooled
(boolean b) informs the sender that the obtained connection is from a pool (and thus connections are reused and never closed)void
setDataSourceFactory
(IDataSourceFactory dataSourceFactory) void
setDatasourceName
(String datasourceName) JNDI name of datasource to be used, can be configured via jmsRealm, toovoid
setDbmsSupportFactory
(DbmsSupportFactory dbmsSupportFactory) void
setJmsRealm
(String jmsRealmName) Deprecated, for removal: This API element is subject to removal in a future version.void
setPassword
(String password) Password for authentication when connecting to database, when none found fromauthAlias
void
setTransacted
(boolean transacted) controls the use of transactionsvoid
setUsername
(String username) User name for authentication when connecting to database, when none found fromauthAlias
Methods inherited from class org.frankframework.jndi.JndiBase
getApplicationContext, getAuthentication, getConfigurationClassLoader, getContext, getCredentials, getInitialContextFactoryName, getJmsRealmName, getJndiAuthAlias, getJndiContextPrefix, getJndiEnv, getJndiProperties, getName, getPrincipal, getProviderURL, getSecurityProtocol, getUrlPkgPrefixes, setApplicationContext, setAuthentication, setCredentials, setInitialContextFactoryName, setJndiAuthAlias, setJndiContextPrefix, setJndiProperties, setName, setPrincipal, setProviderURL, setSecurityProtocol, setUrlPkgPrefixes, stop, toString
-
Constructor Details
-
JdbcFacade
public JdbcFacade()
-
-
Method Details
-
getLogPrefix
-
configure
- Specified by:
configure
in interfaceIConfigurable
- Overrides:
configure
in classJndiBase
- Throws:
ConfigurationException
-
getDatasource
- Throws:
JdbcException
-
getDatasourceInfo
Deprecated.- Throws:
JdbcException
-
setDbmsSupportFactory
-
getDbmsSupport
-
getConnection
Obtains a connection to the datasource.- Throws:
JdbcException
-
getConnectionWithTimeout
- Throws:
JdbcException
TimeoutException
-
setJmsRealm
@Deprecated(forRemoval=true, since="7.7.0") @ConfigurationWarning("We discourage the use of jmsRealms for datasources. To specify a datasource other then the default, use the datasourceName attribute directly, instead of referring to a realm") public void setJmsRealm(String jmsRealmName) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:JndiBase
loads JNDI (and other) properties from a JmsRealm- Overrides:
setJmsRealm
in classJndiBase
- See Also:
-
getPhysicalDestinationName
Returns the name and location of the database that this objects operates on. If no previous connection was made or it cannot determine the destination it returns 'unknown'- Specified by:
getPhysicalDestinationName
in interfaceHasPhysicalDestination
- See Also:
-
setDatasourceName
JNDI name of datasource to be used, can be configured via jmsRealm, too- Default value
- "jdbc.datasource.default"
-
getDatasourceName
-
setAuthAlias
Authentication alias used to authenticate when connecting to database -
setUsername
User name for authentication when connecting to database, when none found fromauthAlias
-
setPassword
Password for authentication when connecting to database, when none found fromauthAlias
-
getPassword
-
setTransacted
public void setTransacted(boolean transacted) controls the use of transactions -
isTransacted
public boolean isTransacted()Description copied from interface:IXAEnabled
indicates implementing object is under transaction control, using XA-transactions- Specified by:
isTransacted
in interfaceIXAEnabled
-
setConnectionsArePooled
public void setConnectionsArePooled(boolean b) informs the sender that the obtained connection is from a pool (and thus connections are reused and never closed)- Default value
- true
-
isConnectionsArePooled
public boolean isConnectionsArePooled() -
getDomain
- Specified by:
getDomain
in interfaceHasPhysicalDestination
-
getAuthAlias
-
getUsername
-
setDataSourceFactory
-
getDataSourceFactory
-