Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
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: 31634

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]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, 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