com.informix.jdbcx

Class IfxDataSource

  • All Implemented Interfaces:
    java.io.Serializable, java.sql.Wrapper, javax.naming.Referenceable, javax.sql.CommonDataSource, javax.sql.DataSource


    public class IfxDataSource
    extends IfxCoreDataSource
    implements javax.sql.DataSource, javax.naming.Referenceable

    IfxDataSource class is the Informix implementation of javax.sql.DataSource.

    See Also:
    DataSource, IfxCoreDataSource, Serialized Form
    • Constructor Detail

      • IfxDataSource

        public IfxDataSource()
        Allocates an empty IfxDataSource object.
      • IfxDataSource

        public IfxDataSource(IfxConnectionPoolDataSource lcpds)
                      throws java.sql.SQLException
        Allocates an IfxDataSource object using the properties of the input ConnectionPoolDataSource.
        Parameters:
        lcpds - the ConnectionPoolDataSource object that contains the properties needed to make the physical connection.
        Throws:
        java.sql.SQLException - if error is encountered while instantiating the object.
        See Also:
        IfxConnectionPoolDataSource
      • IfxDataSource

        public IfxDataSource(java.lang.String url)
                      throws java.sql.SQLException
        Throws:
        java.sql.SQLException
    • Method Detail

      • getConnection

        public java.sql.Connection getConnection()
                                          throws java.sql.SQLException
        Attempts to establish a connection to the data source that this DataSource object represents.
        Specified by:
        getConnection in interface javax.sql.DataSource
        Throws:
        java.sql.SQLException - if a database-access error occurs.
      • getConnection

        public java.sql.Connection getConnection(java.lang.String luser,
                                                 java.lang.String lpassword)
                                          throws java.sql.SQLException
        Attempts to establish a connection to the data source that this DataSource object represents.
        Specified by:
        getConnection in interface javax.sql.DataSource
        Parameters:
        user - the data source user on whose behalf the connection is being made.
        password - the user's password.
        Throws:
        java.sql.SQLException - if a database-access error occurs.
      • getReference

        public javax.naming.Reference getReference()
                                            throws javax.naming.NamingException
        This method implements the Referenceable interface. Perhaps it should be called, makeReference. It is used by the naming service provider to create a reference object that embodies enough information about this datasource such that the datasource can be recreated when naming.lookup() is called. This reference is only used internally by the naming service. It is eventually bound to a user specified name (in naming.bind()) and subsequently, it is used to reconstruct the datasource when naming.lookup() is called with the given name.
        Specified by:
        getReference in interface javax.naming.Referenceable
        Returns:
        reference to the datasource.
        Throws:
        javax.naming.NamingException
      • getCPMFreeCount

        public int getCPMFreeCount()
      • activateHDRPool_Primary

        public void activateHDRPool_Primary()
      • activateHDRPool_Secondary

        public void activateHDRPool_Secondary()
      • isWrapperFor

        public boolean isWrapperFor(java.lang.Class<?> iface)
        Specified by:
        isWrapperFor in interface java.sql.Wrapper
      • unwrap

        public <T> T unwrap(java.lang.Class<T> iface)
                     throws java.sql.SQLException
        Specified by:
        unwrap in interface java.sql.Wrapper
        Throws:
        java.sql.SQLException
      • getParentLogger

        public java.util.logging.Logger getParentLogger()
                                                 throws java.sql.SQLFeatureNotSupportedException
        Specified by:
        getParentLogger in interface javax.sql.CommonDataSource
        Throws:
        java.sql.SQLFeatureNotSupportedException