Class BaseConnectionFactory

    • Constructor Detail

      • BaseConnectionFactory

        protected BaseConnectionFactory​(JdbcDataSource ds)
                                 throws java.sql.SQLException
        Parameters:
        stream - A configuration file as an InputStream.
        dsName - The data source's name.
        Throws:
        java.beans.PropertyVetoException - if any.
        java.sql.SQLException - if any.
    • Method Detail

      • initializePool

        protected abstract void initializePool​(JdbcDataSource ds)
                                        throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getUrl

        public abstract java.lang.String getUrl()

        getUrl

        Returns:
        a String object.
      • setUrl

        public abstract void setUrl​(java.lang.String url)

        setUrl

        Parameters:
        url - a String object.
      • getUser

        public abstract java.lang.String getUser()

        getUser

        Returns:
        a String object.
      • setUser

        public abstract void setUser​(java.lang.String user)

        setUser

        Parameters:
        user - a String object.
      • getDataSource

        public abstract javax.sql.DataSource getDataSource()

        getDataSource

        Returns:
        a DataSource object.
      • getLoginTimeout

        public abstract int getLoginTimeout()
                                     throws java.sql.SQLException

        getLoginTimeout

        Specified by:
        getLoginTimeout in interface javax.sql.CommonDataSource
        Specified by:
        getLoginTimeout in interface javax.sql.DataSource
        Returns:
        a int.
        Throws:
        java.sql.SQLException - if any.
      • close

        public void close()

        close

        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface ClosableDataSource
        Specified by:
        close in interface java.io.Closeable
      • unwrap

        public <T> T unwrap​(java.lang.Class<T> iface)

        unwrap

        Specified by:
        unwrap in interface java.sql.Wrapper
        Type Parameters:
        T - a T object.
        Parameters:
        iface - a Class object.
        Returns:
        a T object.
      • isWrapperFor

        public boolean isWrapperFor​(java.lang.Class<?> iface)

        isWrapperFor

        Specified by:
        isWrapperFor in interface java.sql.Wrapper
        Parameters:
        iface - a Class object.
        Returns:
        a boolean.
      • validateJdbcUrl

        protected static void validateJdbcUrl​(java.lang.String url)