Package org.h2gis.functions.factory
Class H2GISDBFactory
java.lang.Object
org.h2gis.functions.factory.H2GISDBFactory
Used to create quickly a database on unit tests.
- Author:
- Nicolas Fortin, Erwan Bocher
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic DataSourcecreateDataSource(String dbName, boolean initSpatial) Create a database and return a DataSourcestatic DataSourcecreateDataSource(String dbName, boolean initSpatial, String h2Parameters) Create a database and return a DataSourcestatic DataSourcecreateDataSource(Properties properties) Create a database, init spatial funcyion and return a DataSourcestatic DataSourcecreateDataSource(Properties properties, boolean initSpatial) Create a database and return a DataSourcestatic ConnectioncreateSpatialDataBase(String dbName) Create a spatial databasestatic ConnectioncreateSpatialDataBase(String dbName, boolean initSpatial) Create a spatial database and register all H2GIS functionsstatic ConnectioncreateSpatialDataBase(String dbName, boolean initSpatial, String h2Parameters) Create a spatial databasestatic ConnectionopenSpatialDataBase(String dbName) Open the connection to an existing database
-
Field Details
-
H2_PARAMETERS
- See Also:
-
-
Method Details
-
openSpatialDataBase
public static Connection openSpatialDataBase(String dbName) throws SQLException, ClassNotFoundException Open the connection to an existing database- Parameters:
dbName-- Returns:
- Throws:
SQLExceptionClassNotFoundException
-
createSpatialDataBase
public static Connection createSpatialDataBase(String dbName) throws SQLException, ClassNotFoundException Create a spatial database- Parameters:
dbName- filename- Returns:
- Connection
- Throws:
SQLExceptionClassNotFoundException
-
createDataSource
Create a database and return a DataSource- Parameters:
dbName- DataBase name, or path URIinitSpatial- True to enable basic spatial capabilities- Returns:
- DataSource
- Throws:
SQLException
-
createDataSource
Create a database, init spatial funcyion and return a DataSource- Parameters:
properties- for the opening of the DataBase.- Returns:
- a DataSource
- Throws:
SQLException
-
createDataSource
public static DataSource createDataSource(Properties properties, boolean initSpatial) throws SQLException Create a database and return a DataSource- Parameters:
properties- for the opening of the DataBase.initSpatial- true to load the spatial functions- Returns:
- a DataSource
- Throws:
SQLException
-
createDataSource
public static DataSource createDataSource(String dbName, boolean initSpatial, String h2Parameters) throws SQLException Create a database and return a DataSource- Parameters:
dbName-initSpatial-h2Parameters-- Returns:
- Throws:
SQLException
-
createSpatialDataBase
public static Connection createSpatialDataBase(String dbName, boolean initSpatial, String h2Parameters) throws SQLException, ClassNotFoundException Create a spatial database- Parameters:
dbName- filenameinitSpatial- If true add spatial features to the databaseh2Parameters- Additional h2 parameters- Returns:
- Connection
- Throws:
SQLExceptionClassNotFoundException
-
createSpatialDataBase
public static Connection createSpatialDataBase(String dbName, boolean initSpatial) throws SQLException, ClassNotFoundException Create a spatial database and register all H2GIS functions- Parameters:
dbName- filenameinitSpatial- If true add spatial features to the database- Returns:
- Connection
- Throws:
SQLExceptionClassNotFoundException
-