This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring 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
It's not a secret anymore!