File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes JDBC Related Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC Related Question" Watch "JDBC Related Question" New topic

JDBC Related Question

Krishna Gokidi

Joined: Jul 02, 2008
Posts: 4
Is it possible to call Stored Procedure without using collable statement.
I means by using some prepare stmt or some thing else ?
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33113

Welcome to JavaRanch!

A CallableStatement extends PreparedStatement so in some sense it is one. Why don't you want to use a CallableStatement? This is they way to use stored procedures using JDBC. The answer to the limitation you are trying to avoid will help suggest a solution or alternative.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Krishna Gokidi

Joined: Jul 02, 2008
Posts: 4
Thanks for giving quick response.

I am just looking for some alternatives its not needed just for the shake of knowledge and practise.

no problem I will try from my side, and if stuck some where again come back to you.

once again thanks
Brian Hart II

Joined: Jul 04, 2008
Posts: 3
The Spring framework has a great wrapper for stored Procedures:

public class TitlesAndGenresStoredProcedure extends StoredProcedure {

private static final String SPROC_NAME = "AllTitlesAndGenres";

public TitlesAndGenresStoredProcedure(DataSource dataSource) {
super(dataSource, SPROC_NAME);
declareParameter(new SqlOutParameter("titles", OracleTypes.CURSOR, new TitleMapper()));
declareParameter(new SqlOutParameter("genres", OracleTypes.CURSOR, new GenreMapper()));

public Map execute() {
// again, this sproc has no input parameters, so an empty Map is supplied...
return super.execute(new HashMap());
I agree. Here's the link:
subject: JDBC Related Question
It's not a secret anymore!