X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1B4C43A5DFA for ; Mon, 6 Dec 2004 01:28:57 +0000 (GMT) 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 34847-01 for ; Mon, 6 Dec 2004 01:28:43 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 20D2C3A5E4E for ; Mon, 6 Dec 2004 01:28:44 +0000 (GMT) Received: (qmail 28507 invoked from network); 6 Dec 2004 01:28:26 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 6 Dec 2004 01:28:26 -0000 Message-ID: <41B3B5C3.10403@fastcrypt.com> Date: Sun, 05 Dec 2004 20:28:35 -0500 From: Dave Cramer Reply-To: pg@fastcrypt.com Organization: Postgres International User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Gaetano Sferra Cc: pgsql-interfaces Subject: Re: jdbc and refcursor problem References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/8 X-Sequence-Number: 5179 Gaetano, Try posting this to the jdbc list pgsql-jdbc@postgresql.org Dave Gaetano Sferra wrote: >Hello to all, >I need to process a cursor returned by a stored function, >reading the jdbc driver docs I learned how to do it but I got a strange behavior >using metadata. >For xample: > >CallableStatement cstm = conn.prepareCall("{ ? = call myfunction() }"); >cstm.registerOutParameter(1, Types.OTHER); >cstm.execute(); > >ResultSet rs = (ResultSet) cstm.getObject(1); >ResutlSetMetaData rsmd = rs.getMetaData(); >int columns = rsmd.getColumnCount() // <-- this throw a NullPointerException > >I got a NullPointerException when try to retrieve the ResultSet column count >even if the ResultSet contains or not data. Is there a workaround? > >Thanks, >Gaetano Sferra > > > >____________________________________________________________ >Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega, senza costi di attivazione. >Abbonati subito su http://www.libero.it > > > >---------------------------(end of broadcast)--------------------------- >TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > > > > -- Dave Cramer http://www.postgresintl.com 519 939 0336 ICQ#14675561