Tuesday, November 11, 2008

Callable statement not supported(Mysql)

Calling a stored procedure from a java.

try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();

String url = "jdbc:mysql://localhost/mysql";

con = DriverManager.getConnection(url, "root", "test");

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

CallableStatement stmt = con.prepareCall ("{call cursorproc (?,?)}");
 
Ans:
 
  • CallableStatement

    Starting with Connector/J 3.1.1, stored procedures are supported when connecting to MySQL version 5.0 or newer via the CallableStatement interface. Currently, the getParameterMetaData() method of CallableStatement is not supported.

  • Refer : http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-implementation-notes.html


  • No comments: