All...<br>
<br>
Has anyone been able to insert geometries using a standard JDBC
PreparedStatement successfully with Postgis 1.1.3 & Postgresql
8.1.4?  I had this working with postgis 0.8 & Postgresql 7.4.1
but I'm now upgrading to the latest versions.<br>
<br>
Here's what I'm attempting to do (stripped down for simplicity...error handling removed etc.):<br>
<br>
==========>8==========<br>
String psqlInsertLine =<br>
    "INSERT INTO gis_table (id, attr1, geometry, attr2) " +<br>
    "VALUES (?, ?, GeometryFromText(?,4267), ?)";<br>PreparedStatement insertStmt = conn.prepareStatement(psqlInsertLine);<br><br>String geometry = getGeometry(attr1, attr2); // get a geometry based<br>on the attributes...
<br><br>insertStmt.setString(1, id);<br>insertStmt.setString(2, attr1);<br>insertStmt.setString(3, geometry);<br>insertStmt.setString(4, attr2);<br><br>insertStmt.executeUpdate();<br><br>==========8<==========<br>
<br>
geometry is a string. For example:<br>
"'LINESTRING(-113.7568111 57.1167611 ,-113.7568111 57.1167611 ,-113.8803611 57.1146194 ,-113.8803611 57.1146194 )'"<br>
<br>
This works under 0.8 but with 1.1.3 I'm getting the following error:<br>
<br>
org.postgresql.util.PSQLException: ERROR: Invalid OGC WKT (does not start with P,L,M or G)<br>
<br>
As you can see my WKT does, in fact, start with an L ?!?<br>
<br>
Does anyone how to get this working?  What am I doing wrong?<br>
<br>
Thanks,<br>
Corey<br>