Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

SQLException: Callable statments not supported.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
// 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
 
Bartender
Posts: 2659
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic