Class NetezzaDialect

  • All Implemented Interfaces:
    Dialect

    public class NetezzaDialect
    extends PostgreSqlDialect
    Implementation of Dialect for the Netezza database.
    Since:
    April 17, 2009
    Author:
    swood
    • Constructor Detail

    • Method Detail

      • generateRegularExpression

        public String generateRegularExpression​(String source,
                                                String javaRegex)
        Description copied from interface: Dialect
        Must generate a String representing a regular expression match operation between a string literal and a Java regular expression. The string literal might be a column identifier or some other identifier, but the implementation must presume that it is already escaped and fit for use. The regular expression is not escaped and must be adapted to the proper dialect rules.

        Postgres / Greenplum example:

        generateRegularExpression( "'foodmart'.'customer_name'", "(?i).*oo.*") -> 'foodmart'.'customer_name' ~ "(?i).*oo.*"

        Oracle example:

        generateRegularExpression( "'foodmart'.'customer_name'", ".*oo.*") -> REGEXP_LIKE('foodmart'.'customer_name', ".*oo.*")

        Dialects are allowed to return null if the dialect cannot convert that particular regular expression into something that the database would support.

        Specified by:
        generateRegularExpression in interface Dialect
        Overrides:
        generateRegularExpression in class PostgreSqlDialect
        Parameters:
        source - A String identifying the column to match against.
        javaRegex - A Java regular expression to match against.
        Returns:
        A dialect specific matching operation, or null if the dialect cannot convert that particular regular expression into something that the database would support.
      • getType

        public SqlStatement.Type getType​(ResultSetMetaData metaData,
                                         int columnIndex)
                                  throws SQLException
        Description copied from interface: Dialect

        Chooses the most appropriate type for accessing the values of a column in a result set for a dialect.

        Dialect-specific nuances involving type representation should be encapsulated in implementing methods. For example, if a dialect has implicit rules involving scale or precision, they should be handled within this method so the client can simply retrieve the "best fit" SqlStatement.Type for the column.

        Specified by:
        getType in interface Dialect
        Overrides:
        getType in class PostgreSqlDialect
        Parameters:
        metaData - Results set metadata
        columnIndex - Column ordinal (0-based)
        Returns:
        the most appropriate SqlStatement.Type for the column
        Throws:
        SQLException