Enum Dialect

java.lang.Object
java.lang.Enum<Dialect>
org.apache.sis.internal.metadata.sql.Dialect
All Implemented Interfaces:
Serializable, Comparable<Dialect>, java.lang.constant.Constable

public enum Dialect extends Enum<Dialect>
The SQL dialect used by a connection. This class defines also a few driver-specific operations that cannot (to our knowledge) be inferred from the DatabaseMetaData.
Since:
0.7
Version:
1.1
  • Enum Constant Details

    • ANSI

      public static final Dialect ANSI
      The database is presumed to use ANSI SQL syntax.
      See Also:
    • DERBY

      public static final Dialect DERBY
      The database uses Derby syntax. This is ANSI, with some constraints that PostgreSQL does not have (for example column with UNIQUE constraint must explicitly be specified as NOT NULL).
    • HSQL

      public static final Dialect HSQL
      The database uses HSQL syntax. This is ANSI, but does not allow INSERT statements inserting many lines. It also have a SHUTDOWN command which is specific to HSQLDB.
    • POSTGRESQL

      public static final Dialect POSTGRESQL
      The database uses PostgreSQL syntax. This is ANSI, but provided an a separated enumeration value because it allows a few additional commands like VACUUM.
    • ORACLE

      public static final Dialect ORACLE
      The database uses Oracle syntax. This is ANSI, but without "AS" keyword.
    • SQLITE

      public static final Dialect SQLITE
      The database uses SQLite syntax. This is ANSI, but with several limitations.
      See Also:
  • Field Details

    • protocol

      private final String protocol
      The protocol in JDBC URL, or null if unknown. This is the part after "jdbc:" and before the next ':'.
    • supportsTableInheritance

      public final boolean supportsTableInheritance
      Whether this dialect support table inheritance.
    • supportsIndexInheritance

      public final boolean supportsIndexInheritance
      true if child tables inherit the index of their parent tables. This feature is not yet supported in PostgreSQL.
      See Also:
    • supportsAlterTableWithAddConstraint

      public final boolean supportsAlterTableWithAddConstraint
      Whether this dialect support adding table constraints after creation. This feature is not yet supported in SQLite.
      See Also:
  • Constructor Details

    • Dialect

      private Dialect(String protocol, boolean supportsTableInheritance, boolean supportsAlterTableWithAddConstraint)
      Creates a new enumeration value for a SQL dialect for the given protocol.
  • Method Details

    • values

      public static Dialect[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Dialect valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • guess

      public static Dialect guess(DatabaseMetaData metadata) throws SQLException
      Returns the presumed SQL dialect. If this method cannot guess the dialect, than ANSI is presumed.
      Parameters:
      metadata - the database metadata.
      Returns:
      the presumed SQL dialect (never null).
      Throws:
      SQLException - if an error occurred while querying the metadata.