Class AbstractDataSource

  • All Implemented Interfaces:
    javax.sql.CommonDataSource
    Direct Known Subclasses:
    com.impossibl.postgres.jdbc.AbstractGeneratedDataSource

    public abstract class AbstractDataSource
    extends java.lang.Object
    implements javax.sql.CommonDataSource
    Abstract DataSource implementation
    • Field Detail

    • Constructor Detail

      • AbstractDataSource

        protected AbstractDataSource()
        Constructor
    • Method Detail

      • createConnection

        protected PGDirectConnection createConnection​(java.lang.String username,
                                                      java.lang.String password)
                                               throws java.sql.SQLException
        Create a connection
        Parameters:
        username - The user name
        password - The password
        Returns:
        The connection
        Throws:
        java.sql.SQLException - Thrown in case of an error
      • createReference

        protected abstract javax.naming.Reference createReference()
        Create a reference using the correct ObjectFactory instance
        Returns:
        The reference
      • getReference

        public javax.naming.Reference getReference()
      • init

        public void init​(javax.naming.Reference reference)
        Init
        Parameters:
        reference - The reference
      • getDescription

        public abstract java.lang.String getDescription()
      • getLoginTimeout

        public int getLoginTimeout()
                            throws java.sql.SQLException
        Specified by:
        getLoginTimeout in interface javax.sql.CommonDataSource
        Throws:
        java.sql.SQLException
      • setLoginTimeout

        public void setLoginTimeout​(int seconds)
                             throws java.sql.SQLException
        Specified by:
        setLoginTimeout in interface javax.sql.CommonDataSource
        Throws:
        java.sql.SQLException
      • getLogWriter

        public java.io.PrintWriter getLogWriter()
                                         throws java.sql.SQLException
        Specified by:
        getLogWriter in interface javax.sql.CommonDataSource
        Throws:
        java.sql.SQLException
      • setLogWriter

        public void setLogWriter​(java.io.PrintWriter out)
                          throws java.sql.SQLException
        Specified by:
        setLogWriter in interface javax.sql.CommonDataSource
        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
      • getHost

        public java.lang.String getHost()
      • setHost

        public void setHost​(java.lang.String v)
      • getPort

        public int getPort()
      • setPort

        public void setPort​(int v)
      • getClientEncoding

        public java.lang.String getClientEncoding()
      • setClientEncoding

        public void setClientEncoding​(java.lang.String v)