Class DerbyDictionary

    • Field Detail

      • shutdownOnClose

        public boolean shutdownOnClose
        If true, we will shutdown the embedded database when closing the DataSource.
    • Constructor Detail

      • DerbyDictionary

        public DerbyDictionary()
    • Method Detail

      • connectedConfiguration

        public void connectedConfiguration​(java.sql.Connection conn)
                                    throws java.sql.SQLException
        Description copied from class: DBDictionary
        This method is called when the dictionary first sees any connection. It is used to initialize dictionary metadata if needed. If you override this method, be sure to call super.connectedConfiguration.
        Overrides:
        connectedConfiguration in class DBDictionary
        Throws:
        java.sql.SQLException
      • appendSelectRange

        protected void appendSelectRange​(SQLBuffer buf,
                                         long start,
                                         long end,
                                         boolean subselect)
        Appends a range to the given buffer.
        A range query is never appended to a subselct clause.
        If this dictionary supports offset and limit on queries then the syntax is
         [ OFFSET {start} ROWS ]
         [ FETCH NEXT {end-start} ROWS ONLY ]
         
        Otherwise, the offset is not used and the syntax is
         [ FETCH FIRST {end} ROWS ONLY ]
         
        Overrides:
        appendSelectRange in class DBDictionary
        Parameters:
        buf - the SQL buffer to be appended
        start - starting offset. 0 means offset is not used.
        end - number of rows to be fetched. Long.MAX_VALUE means no limit.
        subselect - flags if the buffer represents a SQL Subquery clause
      • closeDataSource

        public void closeDataSource​(javax.sql.DataSource dataSource)
        Description copied from class: DBDictionary
        Closes the specified DataSource and releases any resources associated with it.
        Overrides:
        closeDataSource in class DBDictionary
        Parameters:
        dataSource - the DataSource to close
      • isFatalException

        public boolean isFatalException​(int subtype,
                                        java.sql.SQLException ex)
        Description copied from class: DBDictionary
        Determine if the given SQL Exception is fatal or recoverable (such as a timeout). This implementation always returns true (i.e. all exceptions are fatal). The current dictionary implementation can overwrite this method to mark certain exception conditions as recoverable error.
        Overrides:
        isFatalException in class DBDictionary
        Parameters:
        subtype - A constant indicating the category of error as defined in StoreException.
        ex - original SQL Exception as raised by the database driver.
        Returns:
        false if the error is fatal.
      • applyRange

        public int applyRange​(Select select,
                              int count)
        Applies range calculation on the actual number of rows selected by a COUNT(*) query. A range query may use either only the limit or both offset and limit based on database dictionary support and accordingly the number of rows in the result set needs to be modified.
        Overrides:
        applyRange in class DBDictionary
        Parameters:
        select -
        count -
        Returns:
      • getPreferredType

        public int getPreferredType​(int type)
        Derby doesn't support SQL-2003 'WITH TIMEZONE' nor the respective JDBC types.
        Overrides:
        getPreferredType in class DBDictionary