Received: from capitular.tissat.es (capitular.tissat.es [195.77.30.34]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA76035 for ; Mon, 18 Oct 1999 13:06:31 -0400 (EDT) (envelope-from echiner@tissat.es) Received: from tissat.es ([195.77.30.15]) by capitular.tissat.es (Netscape Messaging Server 3.6) with ESMTP id AAA6981 for ; Mon, 18 Oct 1999 19:05:58 +0200 Message-ID: <380B5347.106559E4@tissat.es> Date: Mon, 18 Oct 1999 19:05:11 +0200 From: "Esteban Chiner Sanz" X-Mailer: Mozilla 4.5 [es] (WinNT; U) X-Accept-Language: es MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Problem with PreparedStatement Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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, Esteban Chiner ------------------------------------------------------------ Esteban Chiner Sanz mailto (work): echiner@tissat.es TISSAT Av. Aragon, 30, 5ª planta Phone: 96 393 9950 Valencia (SPAIN)