BUG #3278: PSQLException when using setBinaryStream via JDBC - Mailing list pgsql-bugs

From jeffrey zhao
Subject BUG #3278: PSQLException when using setBinaryStream via JDBC
Date
Msg-id 200705141602.l4EG2g70011058@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #3278: PSQLException when using setBinaryStream via JDBC  (Kris Jurka <books@ejurka.com>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      3278
Logged by:          jeffrey zhao
Email address:      jeffrey.zhao@metalogic-inc.com
PostgreSQL version: 8.2.4-1
Operating system:   Windows XP
Description:        PSQLException when using setBinaryStream via JDBC
Details:

When I run the following program, I got an exception as following:

File file = new File("myimage.gif");
FileInputStream fis = new FileInputStream(file);
PreparedStatement ps = conn.prepareStatement("INSERT INTO images VALUES (?,
?)");
ps.setString(1, file.getName());
ps.setBinaryStream(2, fis, file.length());
ps.executeUpdate();
ps.close();
fis.close();

Exception:

org.postgresql.util.PSQLException: Method
org.postgresql.jdbc4.Jdbc4PreparedStat
ement.setBinaryStream(int, InputStream, long) is not yet implemented.
        at org.postgresql.Driver.notImplemented(Driver.java:728)
        at
org.postgresql.jdbc4.AbstractJdbc4Statement.setBinaryStream(AbstractJ
dbc4Statement.java:70)

Is the method setBinaryStream really not yet implemented?

Thanks.

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: INSTALL appnote for Solaris 10...
Next
From: ""
Date:
Subject: BUG #3279: insert or update