Retrieving bytes error!! - Mailing list pgsql-jdbc

From FERNANDA M.
Subject Retrieving bytes error!!
Date
Msg-id 20031023231935.5743.qmail@web13804.mail.yahoo.com
Whole thread Raw
List pgsql-jdbc
Hello! i have  problem when retrieving a byte array
from postgres.

I'm saving a file (open office) with the following
code...

FileInputStream fis = new
FileInputStream(doc.getFile());
length = (doc.getFile()).length();
PreparedStatement ps = connection.prepareStatement
                                   ("INSERT INTO
documents VALUES (?, ?, ?, ?)");
            ps.setInt(1, doc.getDocumentId());
            ps.setString(2, doc.getFileName());
            ps.setDate(3, new
java.sql.Date(System.currentTimeMillis()));
ps.setBinaryStream(4, fis, (int) length);
            ps.close();


            int insertado=ps.executeUpdate();




=====
.................... F E R D I ............................
Les choses simples sont les plus extraordinaires,
et seuls les savants parviennent � les voir...L'Alchimiste

ferdim@yahoo.com
ferdim79@msn.com

http://geocities.com/ferdim

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

pgsql-jdbc by date:

Previous
From: "ni3india"
Date:
Subject: Source code JDBC driver
Next
From: "FERNANDA M."
Date:
Subject: Retrieving bytes error(complete mail)!!