Reference Citations - HerongYang.com - v2.95, by Herong Yang
How do you get multiple resultset from a single CallableStatement?
'Retrieving Multiple ResultSet Objects' tutorial was cited in a StackOverflow forum post in 2013.
The Retrieving Multiple ResultSet Objects tutorial was cited in a StackOverflow forum post in 2013.
Subject: How do you get multiple resultset from a single
CallableStatement?
Date: Nov 27, 2013
Author: James
Source: http://stackoverflow.com/questions/20254115/how-do-you-get-
multiple-resultset-from-a-single-callablestatement
When I call the stored proc from command line I get the following.
CALL `events`.`get_event_by_id`(10)
+---------+----------+-------------+---------------------+--------...
| evet_id | name | description | starttime | endtime...
+---------+----------+-------------+---------------------+--------...
| 10 | samole 3 | sanely | 2013-11-27 17:37:00 | 2013-11...
+---------+----------+-------------+---------------------+--------...
1 row in set (0.00 sec)
...
Here is a snippet of my Java Code
String SP_GET_EVENT_BY_ID = "CALL `events`.`get_event_by_id`(?)";
String PROC_PARAM_EVENT_ID = "evet_id";
mCallableStatement = mConnection.prepareCall(SP_GET_EVENT_BY_ID);
mCallableStatement.setInt(10, PROC_PARAM_EVENT_ID);
When I execute the statement, only the event_table results are
returned. I read the query with the following:
ResultSet reader = mCallableStatement.executeQuery();
while(reader.next())
{
//etc..... here i assign db values to properties.
}
I am trying to avoid making multiple request to the database because
it's extremely slow (300 ms depending on on how many results)
Is it even possible?
...
I found this great article. https://www.herongyang.com/JDBC/MySQL-
CallableStatement-Multiple-ResulSet.html
Here is the code from that article.
...
Table of Contents
(Android) Getting Current Date and Time
Deatil View with other language
Web-palveluiden koostaminen: web- ja RESTful-palvelut
Corso di Architetture Orientate ai Servizi
Hardening a SAS Installation on a multi tier installation on Linux
[scala-user] for-loops still not optimized in 2.10?
.bin/.cue - the purpose of .cue?
(horror movie) com.hellogood.eCalendar
Using keytool to convert bks file to p12
Error while using LWP::Socket to send XML Data
Distributed Key System Broken Up Over Multiple Nodes
Cant receive MMS with wifi turned on
Including and using the MySql.Data.dll on your web host server
Distributed Key Systems: Enhancing Security...
WP Spreadplugin Basket not shown
►How do you get multiple resultset from a single CallableStatement?
Blowfish Cipher Algorithm in Java