X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 423729FA380 for ; Wed, 13 Sep 2006 14:10:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 61203-02 for ; Wed, 13 Sep 2006 14:10:25 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.234]) by postgresql.org (Postfix) with ESMTP id C4CF89FA20E for ; Wed, 13 Sep 2006 14:10:24 -0300 (ADT) Received: by wx-out-0506.google.com with SMTP id t13so2523742wxc for ; Wed, 13 Sep 2006 10:10:24 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=fCvWElKeox42JtNHkHxT4CAQq7pbe4BhXMcwDWl4GWUQtp//p7cKqADsoAZn8PwHQXN8U76wIp5bxI3/pvnYaL50Fv3jnlahZ1Etk+mshQ9WC+s1pUqGOPbtl98Jb3OuVhh6Ol8ajvAG4pxLz0aQGM3A6PsBh6h2HyBMKDyydQ4= Received: by 10.70.117.1 with SMTP id p1mr10168844wxc; Wed, 13 Sep 2006 10:10:23 -0700 (PDT) Received: by 10.70.48.18 with HTTP; Wed, 13 Sep 2006 10:10:23 -0700 (PDT) Message-ID: <6daed2a30609131010q280c628cv66c7d2a73f2ab769@mail.gmail.com> Date: Wed, 13 Sep 2006 19:10:23 +0200 From: "=?ISO-8859-1?Q?Enrique_Rodr=EDguez_Lasterra?=" To: pgsql-jdbc@postgresql.org Subject: create tables and prepared statements with params MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Google-Sender-Auth: 10e2620fae953f8c X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.614 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/48 X-Sequence-Number: 15766 get an error when i create a table using preparedstatement with some parameters "?". Is this a non standard function? With JDBC 7.4 it runs prefectly but with 8.x no. With 8.x if i don't use params the table is created without errors Here is all the info. Regards, Enrique Code package test; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; /** * DB * * @version 1.0 * @since 13-sep-2006 */ public class DB { public static void main(String[] args) { Connection connection =3D null; try { Class.forName("org.postgresql.Driver"); connection =3D DriverManager.getConnection("jdbc[tongue]ostgresql://192.168.4.221/canyamo-= test", "canyamo-test", "canyamo-test"); PreparedStatement stmt =3D connection.prepareStatement("create table orders ( id integer not null, client character varying(15) default ? not null)"); stmt.setObject(1, "without-name"); stmt.executeUpdate();//stmt.execute(); } catch (Exception e) { e.printStackTrace(); } } } Exception org.postgresql.util.PSQLException: ERROR: there is no parameter $1 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(Que= ryExecutorImpl.java:1527) at org.postgresql.core.v3.QueryExecutorImpl.processResults (QueryExecutorImpl.java:1311) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImp= l.java:190) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2= Statement.java:452) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(Abst= ractJdbc2Statement.java:354) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(Abstrac= tJdbc2Statement.java:308) at test.DB.main(DB.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI= mpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:9= 0) Versions JDBC: 8.1.404 Database: 8.1.4 --=20 _______________________________ Enrique Rodriguez Lasterra lasterra AT javahispano DOT org http://www.javahispano.org Asociaci=F3n sin =E1nimo de lucro sobre java Spanish non profit association about java