Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

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!

JAVA and Postgres File handling

800440Oct 8 2008 — edited Oct 9 2008
Hello !
i am using the following example to save a file to database but the problem is i got a exception
[http://jdbc.postgresql.org/documentation/81/binary-data.html]

the exception is

org.postgresql.util.PSQLException: Unable to bind parameter values for statement.
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:212)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:304)
	at etc.ExtraNotRelatedToProject.main(ExtraNotRelatedToProject.java:130)
Caused by: java.io.EOFException: Premature end of input stream, expected 63 bytes, but only read 0.
	at org.postgresql.core.PGStream.SendStream(PGStream.java:480)
	at org.postgresql.core.v3.SimpleParameterList.streamBytea(SimpleParameterList.java:174)
	at org.postgresql.core.v3.SimpleParameterList.writeV3Value(SimpleParameterList.java:257)
	at org.postgresql.core.v3.QueryExecutorImpl.sendBind(QueryExecutorImpl.java:862)
	at org.postgresql.core.v3.QueryExecutorImpl.sendOneQuery(QueryExecutorImpl.java:1053)
	at org.postgresql.core.v3.QueryExecutorImpl.sendQuery(QueryExecutorImpl.java:644)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:190)
	... 4 more
i need help
Advance Thanks
Shakeel Abbas
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 6 2008
Added on Oct 8 2008
5 comments
1,900 views