Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5CGF5E32479 for ; Tue, 12 Jun 2001 12:15:05 -0400 (EDT) (envelope-from pgsql-docs-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f55DSeE02386 for ; Tue, 5 Jun 2001 09:28:40 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f55DBB185259 for pgsql-docs@postgresql.org; Tue, 5 Jun 2001 09:11:11 -0400 (EDT) (envelope-from news) From: =?iso-8859-1?Q?Hans=2DJ=FCrgen=20Sch=F6nig?= X-Newsgroups: comp.databases.postgresql.docs Subject: users-lounge/docs/7.1/programmer/jdbc-lo.html - ERROR? Date: Tue, 05 Jun 2001 15:09:23 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 25 Message-ID: <3B1CDA02.9CD1E403@cybertec.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.77 [de] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en To: pgsql-docs@postgresql.org X-Archive-Number: 200106/23 X-Sequence-Number: 818 I have copied the code out of the source code but somehow the compiler fails. There seems to be something wrong with the docs. I am using PostgreSQL 7.1.2 on RedHat 7.1. conn.setAutoCommit(false); File file = new File("snapshot.bmp"); 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(); oconnect.java:20: setBinaryStream(int,java.io.InputStream,int) in java.sql.PreparedStatement cannot be applied to (int,java.io.FileInputStream,long) ps.setBinaryStream(2, fis, file.length()); ^ 1 error Hans