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 New to JDBC Callable Satement 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 "New to JDBC Callable Satement" Watch "New to JDBC Callable Satement" New topic

New to JDBC Callable Satement

hari ann

Joined: Dec 09, 2007
Posts: 11

I am learning Callable statement. Just I have the following questions. please help me .

public class Example1{
public static void main(String[] args) {
Connection conn=null;
try {
CallableStatement cast= conn.prepareCall("{call movieproc(?,?)}");
cast.setString(1,"Raja Hindhustani");
int records= cast.exceuteUpdate();
system.out.println(records+"has been inserted");
catch(Exception e){

In this example do we need to define the procedure movieproc seperately?
Jan Cumps

Joined: Dec 20, 2006
Posts: 2565

In this example do we need to define the procedure movieproc seperately?
Yes. You have to create that procedure in your database. It is called a stored procedure.

OCUP UML fundamental and ITIL foundation
I agree. Here's the link:
subject: New to JDBC Callable Satement
jQuery in Action, 3rd edition