Received: from ucs.co.za (ucs.co.za [196.23.43.2]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eA94tis84809 for ; Wed, 8 Nov 2000 23:55:45 -0500 (EST) (envelope-from gaf@ucs.co.za) Received: from ucspost.ucs.co.za (IDENT:root@mailgw1.ucs.co.za [196.23.43.254]) by ucs.co.za (8.9.3/8.9.3) with ESMTP id HAA11161; Thu, 9 Nov 2000 07:06:15 +0200 Received: from jhb.ucs.co.za (jhb.ucs.co.za [172.31.1.73]) by ucspost.ucs.co.za (8.9.3/8.7.3) with ESMTP id GAA16955; Thu, 9 Nov 2000 06:54:55 +0200 Received: from ucs.co.za (IDENT:gaf@pc141.ucs.co.za [172.31.1.141]) by jhb.ucs.co.za (8.9.3/8.8.7) with ESMTP id GAA26763; Thu, 9 Nov 2000 06:59:49 +0200 Message-ID: <3A0A2E19.281C7CB3@ucs.co.za> Date: Thu, 09 Nov 2000 06:54:49 +0200 From: Grant Finnemore X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Christopher Farley CC: pgsql-interfaces@postgresql.org Subject: Re: JDBC 'Unterminated quoted string' References: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.postgresql.org id eA94tls84810 X-Archive-Number: 200011/102 X-Sequence-Number: 138 Christopher, I would suggest that you examine the query that arrives at the backend. (Start the postmaster with the -d2 switch) This should at least give you the source of the unterminated string, and presumably, we can then trace it through the execution of the JDBC driver. Offhand, I would suggest that one of the string fields in the insert has a ' character inside. AFAIK the postgresql jdbc driver does not automatically escape this character. The correct escape would be ''. Regards, Grant Christopher Farley wrote: > I am migrating a Java application from a commercial RDBMS to > Postgresql. The transition has been near-seamless, except I am getting a > troublesome SQLException when executing one of my PreparedStatement > objects. > > The SQLException is 'Unterminated quoted string', and it occurs on a > simple SQL insert statement. I have other insert statements which execute > flawlessly, and this particular statement worked fine on a different > database. > > I searched the archives and the only information I could find on this > error had to do with quoting question-mark (?) literals with ODBC. Since > the JDBC PreparedStatement uses ?, I was wondering if there was a problem > parsing the PreparedStatement. The only thing that distinguishes the > problematic PreparedStatement is that I am inserting a large number of > columns (21). > > I'm using the jdbc7.0-1.1.jar, and running Posgresql 7.0.2. > > Thanks if you can help! > ---- > Christopher Farley > Northern Brewer / 1150 Grand Avenue / St. Paul, MN 55105 > www.northernbrewer.com -- > Poorly planned software requires a genius to write it > and a hero to use it. Grant Finnemore BSc(Eng) (mailto:gaf@ucs.co.za) Software Engineer Universal Computer Services Tel (+27)(11)712-1366 PO Box 31266 Braamfontein 2017, South Africa Cell (+27)(82)604-5536 20th Floor, 209 Smit St., Braamfontein Fax (+27)(11)339-3421 Johannesburg, South Africa