Class SQLServerDictionary

    • Field Detail

      • VENDOR_MICROSOFT

        public static final java.lang.String VENDOR_MICROSOFT
        See Also:
        Constant Field Values
      • VENDOR_NETDIRECT

        public static final java.lang.String VENDOR_NETDIRECT
        See Also:
        Constant Field Values
      • uniqueIdentifierAsVarbinary

        public boolean uniqueIdentifierAsVarbinary
        Flag whether to treat UNIQUEIDENTIFIER as VARBINARY or VARCHAR
      • sendTimeAsString

        public java.lang.Boolean sendTimeAsString
        SQLServer doesn't like a java.sql.Time as default. So either we send it as String or people configure sendTimeAsDatetime=false on the Connection. This is depending how the Database actually is setup. To mitigate misconfiguration we can work around by sending the time as String to the JDBC driver.
    • Constructor Detail

      • SQLServerDictionary

        public SQLServerDictionary()
    • 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
      • getColumns

        public Column[] getColumns​(java.sql.DatabaseMetaData meta,
                                   java.lang.String catalog,
                                   java.lang.String schemaName,
                                   java.lang.String tableName,
                                   java.lang.String columnName,
                                   java.sql.Connection conn)
                            throws java.sql.SQLException
        Description copied from class: DBDictionary
        Reflect on the schema to find columns matching the given table and column patterns.
        Overrides:
        getColumns in class AbstractSQLServerDictionary
        Throws:
        java.sql.SQLException
      • appendXmlComparison

        public void appendXmlComparison​(SQLBuffer buf,
                                        java.lang.String op,
                                        FilterValue lhs,
                                        FilterValue rhs,
                                        boolean lhsxml,
                                        boolean rhsxml)
        If this dictionary supports XML type, use this method to append xml predicate.
        Overrides:
        appendXmlComparison in class DBDictionary
        Parameters:
        buf - the SQL buffer to write the comparison
        op - the comparison operation to perform
        lhs - the left hand side of the comparison
        rhs - the right hand side of the comparison
        lhsxml - indicates whether the left operand maps to xml
        rhsxml - indicates whether the right operand maps to xml
      • setSupportsXMLColumn

        public void setSupportsXMLColumn​(boolean b)
        Overrides:
        setSupportsXMLColumn in class DBDictionary
        Parameters:
        b - boolean representing if XML columns are supported
      • 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.
      • getLOBStream

        public java.io.InputStream getLOBStream​(JDBCStore store,
                                                java.sql.ResultSet rs,
                                                int column)
                                         throws java.sql.SQLException
        Obtain an InputStream by using ResultSet.getBlob(int) and Blob.getBinaryStream(). Unfortunately this will load entire BLOB into memory. The alternative ResultSet.getBinaryStream(int) provides true streaming but the stream can be consumed only as long as ResultSet is open.
        Overrides:
        getLOBStream in class DBDictionary
        Throws:
        java.sql.SQLException
      • getCharacterStream

        public java.io.Reader getCharacterStream​(java.sql.ResultSet rs,
                                                 int column)
                                          throws java.sql.SQLException
        Obtain a Reader by using ResultSet.getClob(int) and Clob.getCharacterStream(). Unfortunately this will load entire CLOB into memory. The alternative ResultSet.getCharacterStream(int) provides true streaming but the stream can be consumed only as long as ResultSet is open.
        Overrides:
        getCharacterStream in class DBDictionary
        Throws:
        java.sql.SQLException
      • getLocalDate

        public java.time.LocalDate getLocalDate​(java.sql.ResultSet rs,
                                                int column)
                                         throws java.sql.SQLException
        Description copied from class: DBDictionary
        Retrieve the specified column of the SQL ResultSet to the proper LocalDate java type.
        Overrides:
        getLocalDate in class DBDictionary
        Throws:
        java.sql.SQLException
      • setLocalTime

        public void setLocalTime​(java.sql.PreparedStatement stmnt,
                                 int idx,
                                 java.time.LocalTime val,
                                 Column col)
                          throws java.sql.SQLException
        Description copied from class: DBDictionary
        Set the given LocalTime value as a parameter to the statement.
        Overrides:
        setLocalTime in class DBDictionary
        Throws:
        java.sql.SQLException
      • getLocalTime

        public java.time.LocalTime getLocalTime​(java.sql.ResultSet rs,
                                                int column)
                                         throws java.sql.SQLException
        Description copied from class: DBDictionary
        Retrieve the specified column of the SQL ResultSet to the proper LocalTime java type.
        Overrides:
        getLocalTime in class DBDictionary
        Throws:
        java.sql.SQLException
      • setLocalDateTime

        public void setLocalDateTime​(java.sql.PreparedStatement stmnt,
                                     int idx,
                                     java.time.LocalDateTime val,
                                     Column col)
                              throws java.sql.SQLException
        Description copied from class: DBDictionary
        Set the given LocalTime value as a parameter to the statement.
        Overrides:
        setLocalDateTime in class DBDictionary
        Throws:
        java.sql.SQLException
      • getLocalDateTime

        public java.time.LocalDateTime getLocalDateTime​(java.sql.ResultSet rs,
                                                        int column)
                                                 throws java.sql.SQLException
        Description copied from class: DBDictionary
        Retrieve the specified column of the SQL ResultSet to the proper LocalDateTime java type.
        Overrides:
        getLocalDateTime in class DBDictionary
        Throws:
        java.sql.SQLException
      • setOffsetDateTime

        public void setOffsetDateTime​(java.sql.PreparedStatement stmnt,
                                      int idx,
                                      java.time.OffsetDateTime val,
                                      Column col)
                               throws java.sql.SQLException
        Description copied from class: DBDictionary
        Set the given LocalTime value as a parameter to the statement.
        Overrides:
        setOffsetDateTime in class DBDictionary
        Throws:
        java.sql.SQLException
      • getOffsetDateTime

        public java.time.OffsetDateTime getOffsetDateTime​(java.sql.ResultSet rs,
                                                          int column)
                                                   throws java.sql.SQLException
        h2 does intentionally not support getTimestamp() for 'TIME WITH TIME ZONE' columns. See h2 ticket #413.
        Overrides:
        getOffsetDateTime in class DBDictionary
        Throws:
        java.sql.SQLException
      • setTime

        public void setTime​(java.sql.PreparedStatement stmnt,
                            int idx,
                            java.sql.Time val,
                            java.util.Calendar cal,
                            Column col)
                     throws java.sql.SQLException
        Description copied from class: DBDictionary
        Set the given value as a parameter to the statement.
        Overrides:
        setTime in class DBDictionary
        Throws:
        java.sql.SQLException
      • indexOf

        public void indexOf​(SQLBuffer buf,
                            FilterValue str,
                            FilterValue find,
                            FilterValue start)
        Description copied from class: DBDictionary
        Invoke this database's indexOf function.
        Overrides:
        indexOf in class DBDictionary
        Parameters:
        buf - the SQL buffer to write the indexOf invocation to
        str - a query value representing the target string
        find - a query value representing the search string
        start - a query value representing the start index, or null to start at the beginning