Package org.h2gis.utilities.dbtypes
Class DBUtils
- java.lang.Object
-
- org.h2gis.utilities.dbtypes.DBUtils
-
public class DBUtils extends Object
Database utilities class.- Author:
- Erwan Bocher (CNRS 2021), Sylvain Palominos (UBS Chaire GEOTERA 2021)
-
-
Constructor Summary
Constructors Constructor Description DBUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DBTypesgetDBType(String url)Return theDBTypesdeduced from the database URL.static DBTypesgetDBType(URI uri)Return theDBTypesdeduced from the database URI.static DBTypesgetDBType(Connection connection)Return theDBTypesof aConnection.
-
-
-
Method Detail
-
getDBType
public static DBTypes getDBType(String url)
Return theDBTypesdeduced from the database URL.- Parameters:
url- Url of the database.- Returns:
- The database
DBTypes.
-
getDBType
public static DBTypes getDBType(URI uri)
Return theDBTypesdeduced from the database URI.- Parameters:
uri- URI of the database.- Returns:
- The database
DBTypes.
-
getDBType
public static DBTypes getDBType(Connection connection) throws SQLException
Return theDBTypesof aConnection. 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
-
-