Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Inserting Information in PostgreSQL interval

843859Jun 21 2009 — edited Jun 21 2009
Hey,

I am having trouble entering intervals into a PostgreSQL inverval field. Currently I using prepared statements that look like this:
PreparedStatement query = conn.prepareStatement("INSERT............");
query.setObject(1, "{28.1, 29.2}");
query.setObject(2, "{1:23, 1:24}");
query.execute();
And when I execute the code I get this error:

org.postgresql.util.PSQLException: ERROR: column "field_1" is of type interval[] but expression is of type character varying


So is there another way of entering an array of intervals into a postgresql database using prepared statement? What am I doing wrong?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 19 2009
Added on Jun 21 2009
2 comments
308 views