X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3A408529F3 for ; Wed, 20 Jul 2005 12:32:15 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 99650-06 for ; Wed, 20 Jul 2005 15:32:03 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 433935281B for ; Wed, 20 Jul 2005 12:32:02 -0300 (ADT) Received: (qmail 27165 invoked from network); 20 Jul 2005 15:32:01 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 20 Jul 2005 15:32:01 -0000 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v733) Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed Message-Id: <7D171EB2-B1AF-4A72-A400-9074EA9B555E@fastcrypt.com> Cc: pgsql-jdbc@postgresql.org Content-Transfer-Encoding: quoted-printable From: Dave Cramer Subject: Re: a question, please help me. Date: Wed, 20 Jul 2005 11:32:00 -0400 To: wu xiao X-Mailer: Apple Mail (2.733) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.416 tagged_above=0 required=5 tests=AWL, DEAR_SOMETHING X-Spam-Level: X-Archive-Number: 200507/177 X-Sequence-Number: 13325 What does the table definition look like ? in the first example you don't get the result by name so it could be =20 any column. Dave On 20-Jul-05, at 3:00 AM, wu xiao wrote: > Dear Sir or Madam, > I am in trouble when I try to connect postgresql 8.03 to =20 > JBuilder9 with JDBC3 8.1. When I use no-parameter sql, my project =20 > runs well. For example, > > Connection db =3D DriverManager.getConnection(url,user,pwd); > Statement st =3D db.createStatement(); > ResultSet rs =3D st.executeQuery("select * from operator"); > while(rs.next()) { > System.out.println("ID: "+rs.getString(1)); > } > rs.close(); > st.close(); > > The results are: > ID: 100 > ID: 101 > ... > > But when I try to use parameter sql, my project has sqlexceptions, =20 > for example: > > Connection db =3D DriverManager.getConnection(url,user,pwd); > PreparedStatement ps =3D db.prepareStatement("select * from operator =20= > where ID=3D?"); > ps.setString(1,100); > ResultSet rs =3D ps.executeQuery(); > if(rs!=3Dnull) { > while(rs.next()) { > System.out.println("ID: "+rs.getString(1)); } > rs.close(); > } > ps.close(); > > The sqlexception is=EF=BC=9A....column 'id' is not exist..... What's = the =20 > reason please? All of the tables are created in Windows XP. > > Thank you for your any suggestion. > > Sincerely, > Thomas Wu > > _________________________________________________________________ > =E4=BA=AB=E7=94=A8=E4=B8=96=E7=95=8C=E4=B8=8A=E6=9C=80=E5=A4=A7=E7=9A=84= =E7=94=B5=E5=AD=90=E9=82=AE=E4=BB=B6=E7=B3=BB=E7=BB=9F=E2=80=94 MSN = Hotmail=E3=80=82 http://=20 > www.hotmail.com > > ---------------------------(end of =20 > broadcast)--------------------------- > TIP 6: explain analyze is your friend > > Dave Cramer davec@postgresintl.com www.postgresintl.com ICQ #14675561 jabber davecramer@jabber.org ph (519 939 0336 )