craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > JDBC/Database Issues Post New Topic   Post A Reply
How to call Stored Procedures that returns values? printer friendly version
next newest post | next oldest post
Author Messages
aegui
Private

Gender: Male
Location:
Registered: May 2006
Status: Offline
Posts: 3

Click here to see the profile for aegui Send email to aegui Send private message to aegui Find more posts by aegui Edit or delete this message Reply w/Quote
Posted Monday, July 10, 2006 @ 12:01:56  

I want to known how to call stored procedures that returns values (or RecordSet).

I have a database with, among others, two tables: Countries and Cities (with populations of each city)

I want to display a matrix with countries in rows and cities in columns.

I think the best way to do that is with a SP.

Could you help me?

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Tuesday, July 11, 2006 @ 05:38:06  

Using stored procedure in quicktable is similar to using select sql

First refer the following page for how to use a select sql to load the data in quicktable.
http://quicktable.org/tutorial/basic.htm

change the following line
// set the select statement which should be used by the table
dBTable1.setSelectSql("select * from employee");

to

dBTable1.setSelectSql("exec getEmployees()"); The exec keyword is specific to your database. Your database may use a keyword other than exec

There is also another approach
dbTable1.connectDatabase();
CallableStatement cst = dbTable1.getConnection().prepareCall("{ call mydb..mysproc( ?,? ) }");
cst.setObject(1, "FirstArgument");
cst.setObject(2, "Second Argument");
ResultSet rs = cst.executeQuery();
dBTable1.refresh(rs);

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios