Class DataSourceConnectionFactory

    • Constructor Summary

      Constructors 
      Constructor Description
      DataSourceConnectionFactory​(javax.sql.DataSource dataSource)
      Constructs an instance for the given DataSource.
      DataSourceConnectionFactory​(javax.sql.DataSource dataSource, java.lang.String userName, char[] userPassword)
      Constructs an instance for the given DataSource.
      DataSourceConnectionFactory​(javax.sql.DataSource dataSource, java.lang.String userName, java.lang.String password)
      Constructs an instance for the given DataSource.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.sql.Connection createConnection()
      Create a new Connection in an implementation specific fashion.
      javax.sql.DataSource getDataSource()  
      java.lang.String getUserName()  
      char[] getUserPassword()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DataSourceConnectionFactory

        public DataSourceConnectionFactory​(javax.sql.DataSource dataSource)
        Constructs an instance for the given DataSource.
        Parameters:
        dataSource - The DataSource for this factory.
      • DataSourceConnectionFactory

        public DataSourceConnectionFactory​(javax.sql.DataSource dataSource,
                                           java.lang.String userName,
                                           char[] userPassword)
        Constructs an instance for the given DataSource.
        Parameters:
        dataSource - The DataSource for this factory.
        userName - The user name.
        userPassword - The user password.
        Since:
        2.4.0
      • DataSourceConnectionFactory

        public DataSourceConnectionFactory​(javax.sql.DataSource dataSource,
                                           java.lang.String userName,
                                           java.lang.String password)
        Constructs an instance for the given DataSource.
        Parameters:
        dataSource - The DataSource for this factory.
        userName - The user name.
        password - The user password.
    • Method Detail

      • createConnection

        public java.sql.Connection createConnection()
                                             throws java.sql.SQLException
        Description copied from interface: ConnectionFactory
        Create a new Connection in an implementation specific fashion.
        Specified by:
        createConnection in interface ConnectionFactory
        Returns:
        a new Connection
        Throws:
        java.sql.SQLException - if a database error occurs creating the connection
      • getDataSource

        public javax.sql.DataSource getDataSource()
        Returns:
        The data source.
        Since:
        2.6.0
      • getUserName

        public java.lang.String getUserName()
        Returns:
        The user name.
        Since:
        2.6.0
      • getUserPassword

        public char[] getUserPassword()
        Returns:
        The user password.
        Since:
        2.6.0