aspose file tools*
The moose likes JDBC and the fly likes MS SQL SERVER StTORED PROCEDURE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MS SQL SERVER StTORED PROCEDURE" Watch "MS SQL SERVER StTORED PROCEDURE" New topic
Author

MS SQL SERVER StTORED PROCEDURE

Govind battacharya
Greenhorn

Joined: Sep 25, 2003
Posts: 3
I am using MS SQL Server and Java
How can i use IN and Out Parameters when i am calling SQL SERver Stored procedure. I am using the following method,
con1=DriverManager.getConnection("jdbc dbc:mydsn","uid","pwd");
CallableStatement cs = con1.prepareCall("{call showEcode}");
ResultSet rs = null;
rs = cs.executeQuery();
in the above i want to pass as string paramenter and similaryly i want to receive a string parameter
ShowEcode is the SQL Server Procedure
but i dont't know how to use IN and Out Parameters(both are string) in the above.
can anybody help me?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

subub sububs
Welcome to Javaranch!
We have a Naming Policy here at the Ranch and since us Barkeeps have nothing better to do than pick on the newbies, we'd like you to conform a bit to our policies. You can change your display name here
Thanks, and again, welcome to the Ranch!!


GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Well, I am not 100% sure about this, but have you tried the Stored Procedure Syntax as in
call showEcode @someParam = 'something'
And the result set should get whatever that returns.
I only have MySQL available right now which doesn't support SP, so I can't test that.
[ September 25, 2003: Message edited by: Gregg Bolinger ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MS SQL SERVER StTORED PROCEDURE