[postgis-users] Re: JDBC PreparedStatements and inserting geometries...
Markus Schaber
schabios at logi-track.com
Mon Feb 28 07:49:59 PST 2005
Hi, Corey,
Corey Puffalt schrieb:
>>>insertStmt.setObject(3, "'MULTILINESTRING ((" + geometry + "))'");
>>You should really use setString() here, so the PGJDBC driver knows that
>>you insert text. This also avoids using text(). Current jdbc drivers
>>have deprecated the untyped setObject(id, obj) calls.
>
> I tried changing it to insertStmt.setString() as you suggested but
> postgres still complains that it's 'character varying' instead of
> text...
Strange, setString() should work for text types. This is possibly a bug
in pgjdbc (or a bug in my knowledge about it), this should possibly
discussed on pgsql-jdbc at postgresql.org
Markus
--
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios at logi-track.com | www.logi-track.com
More information about the postgis-users
mailing list