Package adams.db

Class JDBC


  • public class JDBC
    extends Object
    Utility class for JDBC.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • JDBC

        public JDBC()
    • Method Detail

      • isMySQL

        public static boolean isMySQL​(String url)
        Checks whether this JDBC url represents a MySQL URL.
        Parameters:
        url - the URL to check
        Returns:
        true if MySQL URL
        See Also:
        URL_MYSQL
      • isMySQL

        public static boolean isMySQL​(AbstractDatabaseConnection conn)
        Checks whether this connection represents a MySQL one.
        Parameters:
        conn - the connection to check
        Returns:
        true if MySQL URL
        See Also:
        isMySQL(String)
      • isPostgreSQL

        public static boolean isPostgreSQL​(String url)
        Checks whether this JDBC url represents a PostgreSQL URL.
        Parameters:
        url - the URL to check
        Returns:
        true if PostgreSQL URL
        See Also:
        URL_POSTGRESQL
      • isPostgreSQL

        public static boolean isPostgreSQL​(AbstractDatabaseConnection conn)
        Checks whether this connection represents a PostgreSQL one.
        Parameters:
        conn - the connection to check
        Returns:
        true if PostgreSQL URL
        See Also:
        isPostgreSQL(String)
      • isSQLite

        public static boolean isSQLite​(String url)
        Checks whether this JDBC url represents a SQLite URL.
        Parameters:
        url - the URL to check
        Returns:
        true if SQLite URL
        See Also:
        URL_SQLITE
      • isSQLite

        public static boolean isSQLite​(AbstractDatabaseConnection conn)
        Checks whether this connection represents a SQLite one.
        Parameters:
        conn - the connection to check
        Returns:
        true if SQLite URL
        See Also:
        isSQLite(String)
      • regexpKeyword

        public static String regexpKeyword​(AbstractDatabaseConnection conn)
        Returns the keyword for regular expression matching in queries.
        Parameters:
        conn - the connection to retrieve the keyword for
        Returns:
        the keyword
        Throws:
        IllegalArgumentException - if JDBC connection type not supported
      • regexpKeyword

        public static String regexpKeyword​(String url)
        Returns the keyword for regular expression matching in queries.
        Parameters:
        url - the connection to retrieve the keyword for
        Returns:
        the keyword
        Throws:
        IllegalArgumentException - if JDBC connection type not supported
      • getTypes

        public static AbstractTypes getTypes​(String url)
        Returns the appropriate types.
        Parameters:
        url - the URL to use for identification
        Returns:
        the types
        Throws:
        IllegalArgumentException - if JDBC connection type not supported