Package org.h2gis.functions.factory
Class H2GISFunctions
java.lang.Object
org.h2gis.functions.factory.H2GISFunctions
Add H2GIS features to an H2 database
Execute the following sql to init spatial features :
CREATE ALIAS IF NOT EXISTS H2GIS_FUNCTIONS FOR
"H2GISFunctions.load";
CALL H2GIS_FUNCTIONS();
- Author:
- Erwan Bocher, Nicolas Fortin
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringH2 base type for geometry columnResultSetMetaData.getColumnTypeName(int) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetAlias(org.h2gis.api.Function function) Return the alias name of the functionstatic org.h2gis.api.Function[]static voidload(Connection connection) Register GEOMETRY type and register H2GIS functionsstatic voidload(Connection connection, String BundleSymbolicName, String BundleVersion) Register GEOMETRY type and register H2GIS functionsstatic voidregisterFunction(Statement st, org.h2gis.api.Function function, String packagePrepend) Register a H2GIS java code functionstatic voidregisterFunction(Statement st, org.h2gis.api.Function function, String packagePrepend, boolean dropAlias) Register a H2GIS java code functionstatic voidregisterSpatialTables(Connection connection) Register view in order to create GEOMETRY_COLUMNS standard table.static voidunRegisterFunction(Statement st, org.h2gis.api.Function function) Remove the specified function from the provided DataBase connectionstatic voidunRegisterH2GISFunctions(Connection connection) Unregister spatial type and H2GIS functions from the current connection.
-
Field Details
-
GEOMETRY_BASE_TYPE
H2 base type for geometry columnResultSetMetaData.getColumnTypeName(int)- See Also:
-
-
Constructor Details
-
H2GISFunctions
public H2GISFunctions()
-
-
Method Details
-
getBuiltInsFunctions
public static org.h2gis.api.Function[] getBuiltInsFunctions()- Returns:
- instance of all built-ins functions
-
load
public static void load(Connection connection, String BundleSymbolicName, String BundleVersion) throws SQLException Register GEOMETRY type and register H2GIS functions- Parameters:
connection- Active H2 connectionBundleSymbolicName- OSGi Bundle symbolic nameBundleVersion- OSGi Bundle version- Throws:
SQLException
-
load
Register GEOMETRY type and register H2GIS functions- Parameters:
connection- Active H2 connection- Throws:
SQLException
-
registerSpatialTables
Register view in order to create GEOMETRY_COLUMNS standard table.- Parameters:
connection- Open connection- Throws:
SQLException
-
registerFunction
public static void registerFunction(Statement st, org.h2gis.api.Function function, String packagePrepend) throws SQLException Register a H2GIS java code function- Parameters:
st- SQL Statementfunction- Function instancepackagePrepend- For OSGi environment only, use Bundle-SymbolicName:Bundle-Version:- Throws:
SQLException
-
registerFunction
public static void registerFunction(Statement st, org.h2gis.api.Function function, String packagePrepend, boolean dropAlias) throws SQLException Register a H2GIS java code function- Parameters:
st- SQL Statementfunction- Function instancepackagePrepend- For OSGi environment only, use Bundle-SymbolicName:Bundle-Version:dropAlias- Drop alias if exists before define it.- Throws:
SQLException
-
getAlias
Return the alias name of the function- Parameters:
function- Function instance- Returns:
- the function ALIAS, name of the function in SQL engine
-
unRegisterFunction
public static void unRegisterFunction(Statement st, org.h2gis.api.Function function) throws SQLException Remove the specified function from the provided DataBase connection- Parameters:
st- Active statementfunction- function to remove- Throws:
SQLException
-
unRegisterH2GISFunctions
Unregister spatial type and H2GIS functions from the current connection.- Parameters:
connection- Active H2 connection with DROP ALIAS rights- Throws:
SQLException
-