Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id AC5539F938C for ; Tue, 2 Jan 2007 14:50:08 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 28801-04 for ; Tue, 2 Jan 2007 14:50:00 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from genomemail.chop.edu (genomemail.chop.edu [159.14.214.193]) by postgresql.org (Postfix) with ESMTP id 6D9559F931E for ; Tue, 2 Jan 2007 14:50:01 -0400 (AST) Received: from [159.14.214.141] ([159.14.214.141]) BY genomemail.chop.edu ([159.14.214.193]) WITH ESMTP (4D WebSTAR V Mail (5.3.4)); Tue, 02 Jan 2007 13:49:59 -0500 Message-ID: <459AA957.9080007@genome.chop.edu> Date: Tue, 02 Jan 2007 13:49:59 -0500 From: Kevin Murphy User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: ClassCastException DelegatingPreparedStatement Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/2 X-Sequence-Number: 16367 I'm just getting around to testing out the advice I got from this list a couple weeks ago about prepare thresholds (thanks, Mark & Dave). Using code modeled after the PG JDBC "Server Prepared Statements" code example, I'm getting this runtime error: java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement on the line marked with an asterisk: try { Class.forName("org.postgresql.Driver"); } catch(Exception e) { printError("org.postgresql.Driver class not found in getMedlineListFromParsedText(): ", e.getMessage()); } prestmt = conn.prepareStatement(query); * org.postgresql.PGStatement pgstmt = (org.postgresql.PGStatement)prestmt; pgstmt.setPrepareThreshold(0); I'm using DBCP pooled connections within tomcat. Versions: PG 8.1, postgresql-8.1-407.jdbc3.jar, tomcat 5.5.20, Java 1.5 My Java newbie status is hobbling me. Thanks for any pointers. Thanks, Kevin