Solved

Stored Procedure with multi OUTPUT parameters!

Posted on 2003-12-01
10
350 Views
Last Modified: 2010-05-18
A stored procedure in Microsoft SQL Server 2000 can have parameters and OUTPUT parameters.
I want to get all the OUTPUT parameters back in my Java program.
Please help! Thanx.
0
Comment
Question by:tinh911
  • 5
  • 5
10 Comments
 
LVL 92

Expert Comment

by:objects
ID: 9856432
Register each of them with registerOutParameter()
0
 

Author Comment

by:tinh911
ID: 9856447
Please tell me more.
Your answer is too short.
0
 

Author Comment

by:tinh911
ID: 9856459
May be some sample line of code is good!
0
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 
LVL 92

Expert Comment

by:objects
ID: 9856464
sorry :-)

CallableStatement s = c.prepareCall("{call my_sp[(?, ?)]}");
s.registerOutParemater(1, Types.FLOAT);
s.registerOutParemater(2, Types.INTEGER);
0
 

Author Comment

by:tinh911
ID: 9856493
Yes, it's great, how can I put the OUTPUT parameter in a variable, for example INTEGER myInt. Can I write like this:
myInt = s.someMethod();//to put the OUTPUT parameter in myInt
0
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 9856511
Sorry again, you access them the same way you access any statement parameters:

int x = s.getInt(1);
float f = s.getFloat(2);

0
 

Author Comment

by:tinh911
ID: 9856518
Thank, you're certainly the one get my points!
Thanks again! :-)
0
 
LVL 92

Expert Comment

by:objects
ID: 9856631
Sorry I needed prodding :)

http://www.objects.com.au
0
 

Author Comment

by:tinh911
ID: 9856643
What site is it?
0
 
LVL 92

Expert Comment

by:objects
ID: 9856661
Thats my business, primarily doing Java consulting.
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
github account with ecipse 1 48
SHA2 certs for IIS AND Java? 2 94
Facing this issue for maven proxy setting 2 12
sql import cannot be resolved jsp 3 23
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question