blob setBinaryStream

From: Matt Fair <matt(at)netasol(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: blob setBinaryStream
Date: 2001-09-24 14:46:49
Message-ID: 3BAF4759.5030402@netasol.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Do you need to create a transaction to set blobs?
con.setAutoCommit(false);
FileInputStream fis = new FileInputStream(file);
PreparedStatement ps = con.prepareStatement("update=
userpreferences set image='?' and time=? where user='?'");
Logger.log("Setting Binary Stream");
ps.setBinaryStream(1, fis, length);
ps.setInt(2, (int)new java.util.Date().getTime());
ps.setString(3, user);
ps.executeUpdate();
ps.close();
fis.close();
con.commit();
con.setAutoCommit(true) ;

When Set Binarystream calls the setInt method, it throws a
SQLExceptionParameter index out of range.
Does anyone know what this could be?

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Matt Fair 2001-09-24 14:58:09 Re: blob setBinaryStream
Previous Message Dongsheng Song 2001-09-24 04:41:44 Help: OutOfMemoryError