File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Calling stored procedures from Java Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

Calling stored procedures from Java Servlet

Donna Reschke
Greenhorn

Joined: Jul 05, 2001
Posts: 23
If I need to call a stored procedure with 6 input parameters and 6 output parameters, how would I do this? Would it look like this?...
cstmt = con.prepareCall("{?, ?, ?, ?, ?, ? = CALL MKTDS22B (?, ?, ?, ?, ?, ?)}");
or this?...
cstmt = con.prepareCall("(CALL MKTDS22B (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ,?))" );
Please help! Thanks!
Gerry Giese
Ranch Hand

Joined: Aug 02, 2001
Posts: 247
Donna,
Try the JDBC Documentation at java.sun.com.
You'll probably get a much better response if you post in the JDBC forum instead of the Servlet forum, since this question has nothing to do with Servlets. Bartender, can you move it? Also, you should try searching the JDBC forum for similar questions that may have answers already.


CJP (Certifiable Java Programmer), AMSE (Anti-Microsoft Software Engineer)
Author of Posts in the Saloon
SAFROLE YUTANI
Ranch Hand

Joined: Jul 06, 2001
Posts: 257
Calling a stored procedure from a servlet is a bad idea and usually indicates a poor design. You may want to add a layer of abstraction between your servlet and your data access calls, such as a data access object.
SAF
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

This is a cross post in the JDBC forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling stored procedures from Java Servlet
 
Similar Threads
MS SQL Server and Java...
stored procedure giving me sql error
Confused by stored procedure sql error
Confused by Stored Procedure Error
calling stored procedure