pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Djordje Nikolic <djordje@abanka.co.yu>
To: pgsql-jdbc@postgresql.org
Subject: Prepared statement problem
Date: Wed, 25 Apr 2007 13:30:44 +0200
Message-ID: <462F3BE4.7080503@abanka.co.yu> (raw)

I had a problem with PreparedStatement which uses ? after FROM clause.
Server reported org.postgresql.util.PSQLException: ERROR: syntax error 
at or near "$1"

This is simplified example.

PreparedStatement pstmt;
try {
  pstmt = conn.prepareStatement("SELECT * FROM ?");
  pstmt.setString(1, "ps_nalog");
  pstmt.executeQuery();
} catch (SQLException ex) {
  ex.printStackTrace();
}

Can anybody tell me where is posibble to put ? in a SELECT statement !

best regards,
Djordje Nikolic

www.abanka.co.yu






view thread (3+ messages)  latest in thread

Message-ID: <462F3BE4.7080503@abanka.co.yu>
Permalink:  ../462F3BE4.7080503@abanka.co.yu/
Also on:    postgresql.org/message-id/462F3BE4.7080503@abanka.co.yu

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: djordje@abanka.co.yu
  Subject: Re: Prepared statement problem
  In-Reply-To: <462F3BE4.7080503@abanka.co.yu>
  References: <462F3BE4.7080503@abanka.co.yu>

* 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