Class DBUtils


  • public class DBUtils
    extends Object
    Database utilities class.
    Author:
    Erwan Bocher (CNRS 2021), Sylvain Palominos (UBS Chaire GEOTERA 2021)
    • Constructor Detail

      • DBUtils

        public DBUtils()
    • Method Detail

      • getDBType

        public static DBTypes getDBType​(String url)
        Return the DBTypes deduced from the database URL.
        Parameters:
        url - Url of the database.
        Returns:
        The database DBTypes.
      • getDBType

        public static DBTypes getDBType​(URI uri)
        Return the DBTypes deduced from the database URI.
        Parameters:
        uri - URI of the database.
        Returns:
        The database DBTypes.
      • getDBType

        public static DBTypes getDBType​(Connection connection)
                                 throws SQLException
        Return the DBTypes of a Connection. First, check the connection class. If no type can be asserted, read the metadata to get the database type.
        Parameters:
        connection - Connection to check.
        Returns:
        The database DBTypes.
        Throws:
        SQLException