Problem with PreparedStatement - Mailing list pgsql-interfaces

From Esteban Chiner Sanz
Subject Problem with PreparedStatement
Date
Msg-id 380B5347.106559E4@tissat.es
Whole thread Raw
Responses Re: [INTERFACES] Problem with PreparedStatement
Re: [INTERFACES] Problem with PreparedStatement
List pgsql-interfaces
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="<br>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.esTISSATAv.Aragon, 30, 5ª planta  Phone: 96 393 9950Valencia (SPAIN)
 




pgsql-interfaces by date:

Previous
From: Kambiz Darabi
Date:
Subject: Pgtcl: pg_result numeric indices
Next
From: Gerhard Hintermayer
Date:
Subject: Support for Tcl/Tk 8.2