A H2 Workspace connects to a spatially enabled H2 database.
H2 h2 = new H2("acme", "target/h2") Layer layer = h2.create('widgets',[new Field("geom", "Point"), new Field("name", "String")]) layer.add([new Point(1,1), "one"]) layer.add([new Point(2,2), "two"]) layer.add([new Point(3,3), "three"])
Modifiers | Name | Description |
---|---|---|
static class |
H2.Factory |
The H2 WorkspaceFactory |
Constructor and description |
---|
H2
(java.lang.String name, java.io.File dir) Create a new H2 Workspace with a name and directory |
H2
(java.lang.String name, java.lang.String dir) Create a new H2 Workspace with a name and directory |
H2
(java.io.File file) Create a new H2 Workspace from a database file |
H2
(java.lang.String database, java.lang.String host, java.lang.String port, java.lang.String schema, java.lang.String user, java.lang.String password) Create a new H2 Workspace with a name, host, port, schema, user, and password. |
H2
(Map options = [:], java.lang.String database) Create a new H2 Workspace |
H2
(JDBCDataStore ds) Create a new H2 Workspace from a GeoTools JDBCDataStore |
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.String |
getFormat() Get the format |
Methods inherited from class | Name |
---|---|
class Database |
createIndex, createIndex, createView, deleteIndex, deleteView, getDataSource, getIndexes, getSql, remove |
class Workspace |
add, add, close, create, create, get, getAt, getFormat, getLayers, getNames, getParameters, getWorkspace, getWorkspace, getWorkspaceNames, getWorkspaceParameters, has, readFeatures, remove, remove, withWorkspace, withWorkspace, withWorkspace, wrap |
Create a new H2 Workspace with a name and directory
name
- The name of the databasedir
- The File containing the databaseCreate a new H2 Workspace with a name and directory
name
- The name of the databasedir
- The File containing the databaseCreate a new H2 Workspace from a database file
file
- The H2 database fileCreate a new H2 Workspace with a name, host, port, schema, user, and password.
database
- The database namehost
- The hostport
- The portschema
- The schemauser
- The user namepassword
- The passwordCreate a new H2 Workspace
options
- The optional named parameters
database
- The database name (or JNDI reference name)Create a new H2 Workspace from a GeoTools JDBCDataStore
ds
- The GeoTools JDBCDataStore