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 eA96Eus94501 for ; Thu, 9 Nov 2000 01:14:56 -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 IAA12182; Thu, 9 Nov 2000 08:25:31 +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 IAA07707; Thu, 9 Nov 2000 08:14:10 +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 IAA16753; Thu, 9 Nov 2000 08:19:04 +0200 Message-ID: <3A0A40AD.810D4C7E@ucs.co.za> Date: Thu, 09 Nov 2000 08:14:05 +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 eA96Exs94509 X-Archive-Number: 200011/104 X-Sequence-Number: 140 Christopher, Yep, this is the correct place to discuss bugs... I tried the following code, and it seems to work. Is this similar to what you are trying to do? import java.sql.*; public class JDBCTest { public static void main(String[] args) throws Exception { Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost/test", "jms", "jms"); /* Before running this class, ensure that the database is created. * CREATE DATABASE test; * CREATE TABLE t ( aa char(1) ); */ PreparedStatement ps = conn.prepareStatement("insert into t values (?)"); ps.setString(1, null); ps.executeUpdate(); } } Also, what version of the driver are you using - is it off CVS, the version 7.0.x tarballs, something else? Regards, Grant Christopher Farley wrote: > Grant, > Thanks for the -d2 tip, it will make my life a lot easier for quite > some time! > Actually, I already tested the 'unescaped single quote' theory, and the > JDBC driver *does* escape them for you. > The problem in my case seems to be that the JDBC driver is throwing the > 'unterminated quoted string' because I am inserting a null value into a > char(1) field. I do not have any 'not null' constraints on the field. > I can easily work around this problem now that I understand it, but I'm > pretty sure this is not correct behavior for the JDBC driver. Is this the > proper forum to report bugs, if this is indeed a bug? > > ---- > 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