Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id B61559FB66C for ; Wed, 25 Apr 2007 08:59:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 60179-05 for ; Wed, 25 Apr 2007 08:59:50 -0300 (ADT) X-Greylist: delayed 00:28:49.501947 by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 822569FB8DD for ; Wed, 25 Apr 2007 08:59:55 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from primo.abanka.co.yu (primo.abanka.co.yu [195.178.54.163]) by svr4.postgresql.org (Postfix) with ESMTP id 4F0515AFB06 for ; Wed, 25 Apr 2007 11:30:56 +0000 (GMT) Received: from primo (localhost [127.0.0.1]) by primo (Postfix) with ESMTP id B142C2ABEF for ; Wed, 25 Apr 2007 13:36:14 +0200 (CEST) Received: from localhost ([127.0.0.1]) by mx for pgsql-jdbc@postgresql.org; Wed, 25 Apr 2007 13:33:36 +0200 Message-ID: <462F3BE4.7080503@abanka.co.yu> Date: Wed, 25 Apr 2007 13:30:44 +0200 From: Djordje Nikolic User-Agent: Thunderbird 1.5.0.10 (X11/20070403) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Prepared statement problem Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Anti-Virus: Kaspersky Anti-Virus for MailServers 5.5.3/RELEASE, bases: 25042007 #284372, status: clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200704/116 X-Sequence-Number: 16965 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