Hi, I am having troubles creating a h2 connection.
Can anyone please confirm me that the following is the proper way to go:
Map params = new HashMap();
params.put(JDBCDataStoreFactory.DBTYPE.key, "h2");
params.put(JDBCDataStoreFactory.DATABASE.key, "database");
params.put(JDBCDataStoreFactory.NAMESPACE.key, "/home/moovida/TMP/");
params.put(JDBCDataStoreFactory.PORT.key, port);
params.put(JDBCDataStoreFactory.HOST.key, host);
params.put(JDBCDataStoreFactory.USER.key, user);
params.put(JDBCDataStoreFactory.PASSWD.key, passwd);
spatialDataStore = DataStoreFinder.getDataStore(params);
The problem is that is when I try to create a table with:
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
b.setName("testgeom");
b.setCRS(DefaultGeographicCRS.WGS84);
b.add("the_geom", Point.class);
b.add("id", Long.class);
SimpleFeatureType featureType = b.buildFeatureType();
spatialDataStore.createSchema(featureType);
it complains that:
Caused by: org.h2.jdbc.JdbcSQLException: Table testgeom already
exists; SQL statement:
CREATE TABLE "testgeom" ( "fid" int AUTO_INCREMENT(1) PRIMARY KEY,
"the_geom" BLOB COMMENT 'POINT', "id" BIGINT ) [42101-118]
The table doesn't exist, since the command should create it.
Any idea about what I am doing wrong?
Thanks,
Andrea
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users