pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Esteban Chiner Sanz <echiner@tissat.es>
To: pgsql-interfaces@postgresql.org
Subject: Problem with PreparedStatement
Date: Mon, 18 Oct 1999 19:05:11 +0200
Message-ID: <380B5347.106559E4@tissat.es> (raw)

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.es
 TISSAT
 Av. Aragon, 30, 5ÂȘ planta  Phone: 96 393 9950
 Valencia (SPAIN)





view thread (4+ messages)  latest in thread

Message-ID: <380B5347.106559E4@tissat.es>
Permalink:  ../380B5347.106559E4@tissat.es/
Also on:    postgresql.org/message-id/380B5347.106559E4@tissat.es

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: echiner@tissat.es
  Subject: Re: Problem with PreparedStatement
  In-Reply-To: <380B5347.106559E4@tissat.es>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox