• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

MS SQL SERVER StTORED PROCEDURE

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!!
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic