Package herddb.jdbc

Class BasicHerdDBDataSource

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.sql.Wrapper, javax.sql.CommonDataSource, javax.sql.DataSource
    Direct Known Subclasses:
    HerdDBDataSource, HerdDBEmbeddedDataSource, HerdDBWrappingDataSource

    public class BasicHerdDBDataSource
    extends java.lang.Object
    implements javax.sql.DataSource, java.lang.AutoCloseable
    HerdDB DataSource
    Author:
    enrico.olivelli
    • Field Detail

      • client

        protected herddb.client.HDBClient client
      • properties

        protected final java.util.Properties properties
      • loginTimeout

        protected int loginTimeout
      • maxActive

        protected int maxActive
      • url

        protected java.lang.String url
      • defaultSchema

        protected java.lang.String defaultSchema
    • Constructor Detail

      • BasicHerdDBDataSource

        protected BasicHerdDBDataSource()
      • BasicHerdDBDataSource

        public BasicHerdDBDataSource​(herddb.client.HDBClient client)
    • Method Detail

      • getWaitForTableSpaceTimeout

        public int getWaitForTableSpaceTimeout()
      • setWaitForTableSpaceTimeout

        public void setWaitForTableSpaceTimeout​(int waitForTableSpaceTimeout)
      • getWaitForTableSpace

        public java.lang.String getWaitForTableSpace()
      • setWaitForTableSpace

        public void setWaitForTableSpace​(java.lang.String waitForTableSpace)
      • isDiscoverTableSpaceFromQuery

        public boolean isDiscoverTableSpaceFromQuery()
      • setDiscoverTableSpaceFromQuery

        public void setDiscoverTableSpaceFromQuery​(boolean discoverTableSpaceFromQuery)
      • getMaxActive

        public int getMaxActive()
      • setMaxActive

        public void setMaxActive​(int maxActive)
      • getDefaultSchema

        public java.lang.String getDefaultSchema()
      • setDefaultSchema

        public void setDefaultSchema​(java.lang.String defaultSchema)
      • getUsername

        public java.lang.String getUsername()
      • setUsername

        public void setUsername​(java.lang.String username)
      • getPassword

        public java.lang.String getPassword()
      • setPassword

        public void setPassword​(java.lang.String password)
      • getUrl

        public java.lang.String getUrl()
      • setUrl

        public void setUrl​(java.lang.String url)
      • getProperties

        public java.util.Properties getProperties()
      • doWaitForTableSpace

        protected void doWaitForTableSpace()
                                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • ensureClient

        protected void ensureClient()
                             throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • ensureConnection

        protected void ensureConnection()
                                 throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getClient

        public herddb.client.HDBClient getClient()
      • setClient

        public void setClient​(herddb.client.HDBClient client)
      • getConnection

        public java.sql.Connection getConnection()
                                          throws java.sql.SQLException
        Specified by:
        getConnection in interface javax.sql.DataSource
        Throws:
        java.sql.SQLException
      • getConnection

        public java.sql.Connection getConnection​(java.lang.String username,
                                                 java.lang.String password)
                                          throws java.sql.SQLException
        Specified by:
        getConnection in interface javax.sql.DataSource
        Throws:
        java.sql.SQLException
      • getLogWriter

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

        public void setLogWriter​(java.io.PrintWriter out)
                          throws java.sql.SQLException
        Specified by:
        setLogWriter in interface javax.sql.CommonDataSource
        Specified by:
        setLogWriter in interface javax.sql.DataSource
        Throws:
        java.sql.SQLException
      • setLoginTimeout

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

        public int getLoginTimeout()
                            throws java.sql.SQLException
        Specified by:
        getLoginTimeout in interface javax.sql.CommonDataSource
        Specified by:
        getLoginTimeout in interface javax.sql.DataSource
        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
      • 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
      • isWrapperFor

        public boolean isWrapperFor​(java.lang.Class<?> iface)
                             throws java.sql.SQLException
        Specified by:
        isWrapperFor in interface java.sql.Wrapper
        Throws:
        java.sql.SQLException
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable