X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 4C7519DCA2C for ; Tue, 21 Feb 2006 06:21:11 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 41446-07 for ; Tue, 21 Feb 2006 06:21:13 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 4AD079DCA14 for ; Tue, 21 Feb 2006 06:21:09 -0400 (AST) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr4.postgresql.org (Postfix) with ESMTP id 1F3D55AF0B3 for ; Tue, 21 Feb 2006 10:21:11 +0000 (GMT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FBUdZ-0000wB-RT for pgsql-jdbc@postgresql.org; Tue, 21 Feb 2006 11:20:55 +0100 Received: from 83.145.96.118 ([83.145.96.118]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Feb 2006 11:20:53 +0100 Received: from Marc.Herbert by 83.145.96.118 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Feb 2006 11:20:53 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Marc Herbert Subject: Re: PreparedStatement clearParameters Date: Tue, 21 Feb 2006 11:21:59 +0100 Lines: 30 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 83.145.96.118 User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4 (Jumbo Shrimp, linux) Cancel-Lock: sha1:VlkWCeIyDOLK+7kBI7OBZvcJMtc= X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.347 required=5 tests=[AWL=0.094, RCVD_NUMERIC_HELO=1.253] X-Spam-Score: 1.347 X-Spam-Level: * X-Archive-Number: 200602/159 X-Sequence-Number: 14756 Thomas Burdairon writes: > But, it seems the clearParameters method remove us all the benefit of > prepare statements, because the query is sent again on each > executeQuery/executeUpdate call. > Then, i don't even know if it's a bug, maybe it's a feature (?) I have never read anything in the specifications of the JDBC interface that _guarantees_ anything concerning performance. I only found more or less fuzzy statements like "it is pre-compiled" (what does that mean formally? to what extent?) or that "execution can be faster". The corresponding ODBC documentation is a bit more precise except it specifically caters for the zero-preparation case: If the driver cannot emulate statement preparation, it stores the statement when SQLPrepare is called and submits it for execution when SQLExecute is called. Because emulated statement preparation is not perfect, SQLExecute can return any errors normally returned by SQLPrepare. So this definitely look like a feature ;-) Please correct me when I am wrong. By the way ODBC does not confuse parametrization and preparation like JDBC does.