Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U5LAW-0003j2-2o for pgsql-jdbc@arkaria.postgresql.org; Tue, 12 Feb 2013 19:05:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U5LAV-0004Ok-Hv for pgsql-jdbc@arkaria.postgresql.org; Tue, 12 Feb 2013 19:05:27 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U5LAU-0004Np-EE for pgsql-jdbc@postgresql.org; Tue, 12 Feb 2013 19:05:26 +0000 Received: from h1.cmg1.smtp.forpsi.com ([81.2.195.162]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U5LAP-0006iT-4I for pgsql-jdbc@postgresql.org; Tue, 12 Feb 2013 19:05:25 +0000 Received: from [127.0.0.1] ([92.62.228.233]) by cmg1.smtp.forpsi.com with bizsmtp id zX5H1k00252mtl001X5HKq; Tue, 12 Feb 2013 20:05:17 +0100 Message-ID: <511A926E.4080106@enaktyment.cz> Date: Tue, 12 Feb 2013 20:05:18 +0100 From: Ladislav DANKO User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: rounded brackets in prepared statement Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 1.1 (+) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Hi folks, my setup: Java 1.6, JDBC PostgreSQL JDBC4 driver 9.1-903. Why when I do: PreparedStatement ps = myConnection.prepareStatement("SELECT a,b,c FROM mytable WHERE category ~ ?"); ps.setString(1, "my/super/category/a(bcdef"); result = ps.executeQuery(); I need to escape rounded bracket in setString in this way: ps.setString(1, "super/category/a(bcdef".replaceAll("\\(", "\\\\("))); I think it has somethink to do with regular expessions but ot know much more about it. -- With kind regards, Ladislav DANKO -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc