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 Stored Procedure Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Stored Procedure Problem" Watch "Stored Procedure Problem" New topic

Stored Procedure Problem

Gil Li

Joined: May 27, 2004
Posts: 15
I have added a stored procedure in mySQL database. that stored funstion just gets the input integer and gives with adding number 10.When I execute in mySQL promt that works fine. I tried Java code to get the output. Here is the code. Here i got Exception like 'CallableStatements not Supported' . I dont know what is the problme here. Help me..

import java.sql.*;

public class proc
public static void main(String a[])

Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/jobsearch?user=root&password=");
CallableStatement cs = con.prepareCall("{? = call pr(?)}");




} catch(Exception e){ System.out.println(e);}


Regards,<br /> <br />GILLI
Jyothi Lature
Ranch Hand

Joined: Oct 31, 2001
Posts: 60

Which version of MySQL are u using? Bcoz, MySQL 3.x lacks support of callable statements via the JDBC API. I guess, using the older version is the problem...

Jyothi<br />Sun Certified Java Programmer<br />Brainbench Certified for Javascript
Gil Li

Joined: May 27, 2004
Posts: 15

I am using the latest version mySQL 5.0 which supports stored procedure. But I am not able to invoke the stored procedure via JDBC...I dont know where is the problem....
Thomas Risberg

Joined: Aug 17, 2004
Posts: 4
Looks like the JDBC driver you are using does not support this new feature. You need to download the latest development driver (3.1.4-beta)

Gil Li

Joined: May 27, 2004
Posts: 15
Thats it...

Thankyou Thomas...
I agree. Here's the link:
subject: Stored Procedure Problem
jQuery in Action, 3rd edition