| Author |
JDBC Related Question
|
Krishna Gokidi
Greenhorn
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
internet detective
Marshal
Joined: May 26, 2003
Posts: 26216
|
|
Krishna, 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.
|
[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
Greenhorn
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
Greenhorn
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())); compile(); } public Map execute() { // again, this sproc has no input parameters, so an empty Map is supplied... return super.execute(new HashMap()); } }
|
 |
 |
|
|
subject: JDBC Related Question
|
|
|