From: | News Subsystem <news(at)news(dot)hub(dot)org> |
---|---|
To: | undisclosed-recipients:; |
Subject: | |
Date: | 2013-02-20 14:01:23 |
Message-ID: | 201302201401.r1KE1N0A011068@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
Wed, 20 Feb 2013 06:01:21 -0800 (PST)
Wed, 20 Feb 2013 06:01:21 -0800 (PST)
X-Newsgroups: pgsql.interfaces.jdbc
Date: Wed, 20 Feb 2013 06:01:21 -0800 (PST)
Complaints-To: groups-abuse(at)google(dot)com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=174.115.190.53;
posting-account=hKFGKAkAAAB4U5rGhRuB_p6PSIbpGEph
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <633775d5-77ad-4f49-bf2e-3d5868e26e04(at)googlegroups(dot)com>
Subject: question about PG JDBC expects results of procedures to be consumed
From: thesix campbells <the6campbells(at)gmail(dot)com>
Injection-Date: Wed, 20 Feb 2013 14:01:21 +0000
Content-Type: text/plain; charset=ISO-8859-1
To: pgsql-jdbc(at)postgresql(dot)org
Can someone clarify why the PG/JDBC driver will not support this style of JDBC methods to consume result sets and instead requires the 2nd form. I see examples of how (re 2nd) but not necessarily explanation re why other approaches may not be supported.
org.postgresql.util.PSQLException: Bad value for type int : <unnamed portal 1>
String sproc = "{call pres()}";
CallableStatement cs = conn.prepareCall(sproc);
boolean hasResults = cs.execute();
while (hasResults) {
rs = cs.getResultSet();
while (rs.next()) {
....
}
rs.close();
hasResults = cs.getMoreResults();
}
cs.close();
String sproc = "{? = call pres()}";
CallableStatement cs = conn.prepareCall(sproc);
cs.registerOutParameter(1, Types.OTHER);
cs.execute();
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Cramer | 2013-02-20 14:16:42 | Re: JDBC - PreparedStatement reuse oddity when using setObject() with nulls and setTimestamp() |
Previous Message | Dave Cramer | 2013-02-20 12:01:00 | Re: patch to avoid a NullPointerException |