Link to home
Start Free TrialLog in
Avatar of BrianMc1958
BrianMc1958

asked on

Best practice for getting ResultSet from MS SQL stored procedure?

Dear Experts,

Due to technical difficulties, I'm trying to circumvent a PreparedStatement and instead generate and use an MS SQL stored procedure directly.  However, I've never done it in Java.

I know how to write the stored procedure itself.  But what is the preferred syntax (other than PreparedStatement) to call it and return the ResultSet?

Thanks!
BrianMc1958
ASKER CERTIFIED SOLUTION
Avatar of gatorvip
gatorvip
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TimYates
I just use PreparedStatements with MySQL and Postgres

Maybe that works in MSSQL as well (I've never tried)

     prepareStatement(  "CALL my_function( ?, ? )" ) ;

for example...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BrianMc1958
BrianMc1958

ASKER

Thanks a lot, folks.  Works very nicely.