Get your CodeRanch badge!*
The moose likes JDBC and the fly likes  SQLException: Callable statments not supported. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark " SQLException: Callable statments not supported." Watch " SQLException: Callable statments not supported." New topic
Author

SQLException: Callable statments not supported.

sanjay pandagre
Greenhorn

Joined: Aug 31, 2007
Posts: 1
// Call from java
//Success - Created Connection
//Error - SQLException: Callable statments not supported.


/* java version JDK 1.5
MYSQL version 5.0.22
*/

procedure already created inmy sql. But when i have call in java that time give me error "SQLException: Callable statments not supported."


java program


import java.sql.*;
import java.sql.CallableStatement;
import exception.Excephandling;

public class Createpro {

/**
* @param args
* @throws Exception
* @throws ClassNotFoundException
* @throws SQLException
*/
CallableStatement cs = null;

public static void main(String[] args) throws Exception {

Createpro obj = new Createpro();
obj.get();
}

public void get() throws Excephandling {
Connection con = null;
Statement stmt = null;
CallableStatement cs = null;

String driverName = "com.mysql.jdbc.Driver";
try {
Class.forName(driverName);
} catch (ClassNotFoundException e) {
throw new Excephandling("SYS_1", "Driver class not found", e);
}
String url = "jdbc:mysql://localhost/yatra1";
String user = "root";
String pwd = "local";
try {
con = DriverManager.getConnection(url, user, pwd);
System.out.print("connection created");

stmt = con.createStatement();
stmt.execute("insert into test3 values(7,7,'2007-08-08')");

cs = con.prepareCall("{call p2()}");

} catch (SQLException e) {
System.err.println(" SQLException: " + e.getMessage());

// e.printStackTrace();
}
}

}


pls replay me what problems
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2476
    
    7

Might be related to the version of your MySQL driver (is it a 3.* version, or the mm driver?).
Please try the latest one (5.0 at the time of writing) at MySQL� Connector/J.

Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQLException: Callable statments not supported.
 
Similar Threads
Database Connection
Urgent....
JDBC Error
Stored proc not found...
connection pooling issue in production environment -