Received: from mail.enterprise.net (mail.enterprise.net [194.72.192.18]) by hub.org (8.9.3/8.9.3) with ESMTP id OAA85404 for ; Mon, 18 Oct 1999 14:23:32 -0400 (EDT) (envelope-from olly@lfix.co.uk) Received: from linda.lfix.co.uk (root@max03-056.enterprise.net [194.72.196.56]) by mail.enterprise.net (8.8.5/8.8.5) with ESMTP id TAA12567; Mon, 18 Oct 1999 19:23:30 +0100 (GMT/BST) Received: from lfix.co.uk (olly@localhost [127.0.0.1]) by linda.lfix.co.uk (8.9.3/8.9.3/Debian 8.9.3-6) with ESMTP id TAA00590; Mon, 18 Oct 1999 19:22:56 +0100 Message-Id: <199910181822.TAA00590@linda.lfix.co.uk> X-Mailer: exmh version 2.0.2 2/24/98 (debian) To: "Esteban Chiner Sanz" cc: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] Problem with PreparedStatement In-Reply-To: Message from "Esteban Chiner Sanz" of "Mon, 18 Oct 1999 19:05:11 +0200." <380B5347.106559E4@tissat.es> References: <380B5347.106559E4@tissat.es> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Date: Mon, 18 Oct 1999 19:22:56 +0100 From: "Oliver Elphick" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id OAA85409 "Esteban Chiner Sanz" wrote: >I'm trying to do this: > >if (counter != -1) /* No ha habido ningún error */ > { > PreparedStatement pstmt=null; > sql="insert into tar_historico values (?,?,?)"; > razon="
Query: " + sql; > try { > pstmt = con.prepareStatement(sql); > pstmt.setString(1,Integer.toString(counter)); > pstmt.setString(2,"1"); > pstmt.setTimestamp(3,new Timestamp(new >java.util.Date().getTime())); > pstmt.executeUpdate(sql); > pstmt.close(); > con.close(); > } > >But I get this error message in the PostgreSQL log: > > query: insert into tar_historico values (?,?,?) > ERROR: parser: parse error at or near "," > >What could be the problem? I've tried everything and I haven't found the >solution yet. Please, help. >Thanks in advance, How about: sql="insert into tar_historico values ('?','?','?')"; -- Vote against SPAM: http://www.politik-digital.de/spam/ ======================================== Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver PGP key from public servers; key ID 32B8FAA1 ======================================== "Delight thyself also in the LORD; and he shall give thee the desires of thine heart." Psalms 37:4