JDBC and LOB

Started by Gabriel Lopezalmost 26 years ago2 messagesgeneral
Jump to latest
#1Gabriel Lopez
gabilm@dif.um.es

Hi, I try to run this example:

String query = "INSERT INTO requestTable VALUES (?,?);";
int i = 1;

PreparedStatement ps =
(PreparedStatement)connection.prepareStatement(query);
ps.setInt(1,i);
ByteArrayInputStream bis = new ByteArrayInputStream(b);
ps.setBinaryStream(2,bis,bis.available());
ps.executeUpdate(); // execute the insert statement
System.out.println("ejecuta");
ps.close(); // close the prepared statement
bis.close();

where de segundo parameter is a oid type.

The response is:

SQL Exception: InputStream as parameter not supported

What tipes of InputStream are supported?
Where can I find more information?

Thanks, Gabi.

#2Nagel, Thomas
tna@FIZ-Karlsruhe.DE
In reply to: Gabriel Lopez (#1)
AW: JDBC and LOB

Hi,

-----Urspr�ngliche Nachricht-----
Von: pgsql-general-owner@hub.org
[mailto:pgsql-general-owner@hub.org]Im
Auftrag von Gabriel L�pez Mill�n
Gesendet am: Montag, 10. Juli 2000 12:34
An: postgres; postgres-ayuda
Betreff: [GENERAL] JDBC and LOB

Hi, I try to run this example:

String query = "INSERT INTO requestTable VALUES (?,?);";
int i = 1;

PreparedStatement ps =
(PreparedStatement)connection.prepareStatement(query);
ps.setInt(1,i);
ByteArrayInputStream bis = new ByteArrayInputStream(b);
ps.setBinaryStream(2,bis,bis.available());
ps.executeUpdate(); // execute the insert statement
System.out.println("ejecuta");
ps.close(); // close the prepared statement
bis.close();

where de segundo parameter is a oid type.

The response is:

SQL Exception: InputStream as parameter not supported

The homepage of the driver is http://www.retep.org.uk/postgres/.
Unfortunately
the "what is planned"-item "Add Stream support to large objects" is Delayed
:-(
(I also need it for a project ...)

Bye

Thomas