Hi Justin,
thanks for the reply.
> One thing that strikes me as off is:
>
>> params.put(JDBCDataStoreFactory.NAMESPACE.key, "/home/moovida/TMP/");
>
> If you are trying to specify the location of the file just pout in the
> DATABASE key. So:
>
> params.put(JDBCDataStoreFactory.DATABASE.key, "/home/moovida/TMP/database");
>
> So what it is doing is creating the db in the current working directory, and
> it could be that that db does indeed include the table. I would try cleaning
> the .db files and trying again.
Yes, at some point I noticed that there was a new database in my workspace :)
Anyways, I then made it like you suggest, but I had huge problems with
case sensitivity of the schema in which the table was created.
I am trying out this thing on turn on H2 and Postgres/GIS, and it
doesn't work creating the schema uppercase and then using the same for
the table reference, i.e. I need to use the schema name lowercase.
Probably this is a known thing, and I just never fell into it because
using the public schema?
Thanks,
Andrea
>
> andrea antonello wrote:
>>
>> 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
>
> --
> Justin Deoliveira
> OpenGeo - http://opengeo.org
> Enterprise support for open source geospatial.
>
------------------------------------------------------------------------------
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