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:
JdbcListener, JdbcMessageBrowser, JdbcSenderBase, Locker, SimpleJdbcListener

public class JdbcFacade extends JndiBase implements HasPhysicalDestination, IXAEnabled
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
  • Constructor Details

    • JdbcFacade

      public JdbcFacade()
  • Method Details

    • getLogPrefix

      protected String getLogPrefix()
    • configure

      public void configure() throws ConfigurationException
      Specified by:
      configure in interface IConfigurable
      Overrides:
      configure in class JndiBase
      Throws:
      ConfigurationException
    • getDatasource

      protected DataSource getDatasource() throws JdbcException
      Throws:
      JdbcException
    • getDatasourceInfo

      @Deprecated public String getDatasourceInfo() throws JdbcException
      Deprecated.
      Throws:
      JdbcException
    • setDbmsSupportFactory

      public void setDbmsSupportFactory(DbmsSupportFactory dbmsSupportFactory)
    • getDbmsSupport

      public IDbmsSupport getDbmsSupport()
    • getConnection

      public Connection getConnection() throws JdbcException
      Obtains a connection to the datasource.
      Throws:
      JdbcException
    • getConnectionWithTimeout

      public Connection getConnectionWithTimeout(int timeout) throws JdbcException, TimeoutException
      Throws:
      JdbcException
      TimeoutException
    • setJmsRealm

      @Deprecated @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.
      Description copied from class: JndiBase
      loads JNDI (and other) properties from a JmsRealm
      Overrides:
      setJmsRealm in class JndiBase
      See Also:
    • getPhysicalDestinationName

      public String 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 interface HasPhysicalDestination
      See Also:
    • setDatasourceName

      public void setDatasourceName(String datasourceName)
      JNDI name of datasource to be used, can be configured via jmsRealm, too
      Default value
      "jdbc.datasource.default"
    • getDatasourceName

      public String getDatasourceName()
    • setAuthAlias

      public void setAuthAlias(String authAlias)
      Authentication alias used to authenticate when connecting to database
    • setUsername

      public void setUsername(String username)
      User name for authentication when connecting to database, when none found from authAlias
    • setPassword

      public void setPassword(String password)
      Password for authentication when connecting to database, when none found from authAlias
    • getPassword

      protected String 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 interface IXAEnabled
    • 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

      public String getDomain()
      Specified by:
      getDomain in interface HasPhysicalDestination
    • getAuthAlias

      public String getAuthAlias()
    • getUsername

      public String getUsername()
    • setDataSourceFactory

      public void setDataSourceFactory(IDataSourceFactory dataSourceFactory)
    • getDataSourceFactory

      public IDataSourceFactory getDataSourceFactory()