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 4D39753804 for ; Wed, 30 Mar 2005 15:44:31 +0100 (BST) 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 13742-07 for ; Wed, 30 Mar 2005 14:44:28 +0000 (GMT) Received: from web41205.mail.yahoo.com (web41205.mail.yahoo.com [66.218.93.38]) by svr1.postgresql.org (Postfix) with SMTP id 1930B5379F for ; Wed, 30 Mar 2005 15:44:27 +0100 (BST) Received: (qmail 53897 invoked by uid 60001); 30 Mar 2005 14:44:28 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=1C40OoHcq04tuWeUbZmOt1+uubaDYqtZK9zPBKz9sTfnlax2KFFuML+whpT0bGrRH1oz7DJpPn2LQVC4nW2BWdnPNApxiQIe/tef7BNaZiUVvUh8elkCpjB00U+AuBd42xsb6Jnh+BN0ZQSNuwPc2wP4E1kpoaiwFgEZnZ9qmGo= ; Message-ID: <20050330144428.53895.qmail@web41205.mail.yahoo.com> Received: from [212.159.203.213] by web41205.mail.yahoo.com via HTTP; Wed, 30 Mar 2005 15:44:28 BST Date: Wed, 30 Mar 2005 15:44:28 +0100 (BST) From: Charl Gerber Subject: Re: jdbc/callable statment error To: fake@dusk.homelinux.org, pgsql-jdbc@postgresql.org In-Reply-To: 6667 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.374 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200503/210 X-Sequence-Number: 12602 After experiencing something similar, I read somewhere that CallableStatement's shouldn't be used pre-8.0. I think someone posted on a message board or something. I changed all my java code to call my functions as PreparedStatements: ps = con.prepareStatement("select myFunction(?,?)") ps.setBoolean(1, true); ps.setInt(2, 198); etc. And it worked fine from there on. --- fake@dusk.homelinux.org wrote: > And now that I think of it, I'm useing postgres 7.4 > > Not sure how relevant that is, > > Gary > > > On Wed, Mar 30, 2005 at 01:16:47AM -0800, > fake@dusk.homelinux.org wrote: > > When executing the following statments from > netbeans 4.1 sun app server 8.1 > > > > CallableStatement proc = con.prepareCall("{ ? = > call test_function ( ? ) }"); > > proc.registerOutParameter(1, Types.BOOLEAN); > > proc.setString(2, "testthis"); > > proc.execute(); > > > > This shows up in my server log. > > > > LOG: statement: select * from test_function ( > 'thisTest' ) as result; > > ERROR: function test_function("unknown") does not > exist > > HINT: No function matches the given name and > argument types. You may need to add explicit type > casts. > > > > > > And I get an exception from my app server that > states "No function" etc, etc... > > > > Now, if I cut and paste that into my psql > terminal it appears to work... So I'm really curious > as to why it doesn't work through jdbc... > > > > Couple of things: I'm getting my connection > through a connection pool on my app server and that > appears to be in working order... > > > > Any suggestions? > > > > > > Gary Lucas > > > > ---------------------------(end of > broadcast)--------------------------- > > TIP 8: explain analyze is your friend > > ---------------------------(end of > broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org >