Retrieving bytes error!!

From: "FERNANDA M(dot)" <ferdim(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Retrieving bytes error!!
Date: 2003-10-23 23:19:35
Message-ID: 20031023231935.5743.qmail@web13804.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)yahoo(dot)com
ferdim79(at)msn(dot)com

http://geocities.com/ferdim

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

Browse pgsql-jdbc by date

  From Date Subject
Next Message FERNANDA M. 2003-10-23 23:26:18 Retrieving bytes error(complete mail)!!
Previous Message Greg Johnson 2003-10-23 15:33:50 Prepared Statement Issues.