Computing.Net > Forums > Programming > Java sql server procedure problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Java sql server procedure problem

Reply to Message Icon

Name: shanahanrocks
Date: January 14, 2005 at 07:42:21 Pacific
OS: Windows 2000
CPU/Ram: Pentium 4, 512 Ram
Comment:

I am currently coding Java in Websphere, using Struts. There is a procedure that I am executing that returns a number value, 0 or 1. Well, I cannot figure out how to retrieve this return value in java when executing the procedure. The code used to execute the procedure follows. The procedure was recently changed to return a value representing success or failure, which is why I need some change for the java code.
The code to execute follows:

sql3.append(" Begin ");
sql3.append(" Execute Retire '"+updateSchedNo+"',
'"+updateSchedLineNo+"','"+updateCoilId+"',
'"+update+"'");
sql3.append(" End; ");
sb3.prepareStatement(sql3.toString());
sb3.execute();
sb3.closeResources();

Where sql3 is a StringBuffer and sb3 is from a class named SQLBuilder that uses Connection and PreparedStatement from java.sql.
The procedure is not Oracle, or this would be easier. It is a sql server procedure. If anyone can help, I'd really appreciate it... or if you need more info, just post and ask. Thanks!!



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


java code problem C++ Compiler



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Java sql server procedure problem

Java and SQL Server 7.0 www.computing.net/answers/programming/java-and-sql-server-70/10976.html

connecting sql server from java www.computing.net/answers/programming/connecting-sql-server-from-java/11451.html

VB, SQL server www.computing.net/answers/programming/vb-sql-server-/1159.html