SQL call stored procedure error internal "error when parsing callable statement metadata (missing parameter type)

Source: Internet
Author: User

[6 APR 2005 15:29] Chadwick Baatz
Description: whenCalling a stored procedure with datatype decimal (m,d) (i.e. decimal (18,0)) The Connector/j library throws the exception being  Low.  After looking to the code it appears the Getcallstmtparametertypes method does not expect that a parameter datatype  Could include a comma. Therefore, any stored procedure created with a compound datatype:float (m,d), Decimal (m,d), etc ... 'll has this problem.ErrorMessage:java.sql.SQLException:Internal Error  when parsing callable Statement metadata(missing parameter type) at Com.mysql.jdbc.DatabaseMetaData.getCallStmtParameterTypes (databasemetadata.java:6902)ErrorIn JDBC sampling:java.sql.SQLException:Internal Error  when parsing callable Statement metadata(missing parameter type) at Com.mysql.jdbc.DatabaseMetaData.getProcedureColumns (databasemetadata.java:2653) at COM.M Ysql.jdbc.CallableStatement.determineParameterTypes (callablestatement.java:1042) at Com.mysql.jdbc.callablestatement.<init> (callablestatement.java:83) at Com.mysql.jdbc.Connection.prepareCall (connection.java:1248) at Com.mysql.jdbc.Connection.prepareCall ( connection.java:1225) at testcallablestatement.<init> (testcallablestatement.java:34) at Testcallablestatement.main (testcallablestatement.java:112)How to repeat:Create Stored procedure:delimiter//drop Procedure IF EXISTS test_proc//create Procedure test_proc (Decimalparam DECIMAL ( 18,0) BEGIN SELECT param_list from Mysql.proc WHERE name= ' Test_proc '; End//create JAVA/JDBC program to call Stored procedureimport java.sql.connection;import java.sql.sqlexception;import ja  Va.sql.drivermanager;import Java.sql.callablestatement;public class testclass{public TestClass () {Connection conn =    Null    CallableStatement cstmt = null;            try {//Load class Class.forName ("Com.mysql.jdbc.Driver"); Modify URL with correct user, pass, host, and DB name conn = drivermanager.getconnection ("Jdbc:mysql://Error: "+ ex");    Ex.printstacktrace ();        } finally {if (cstmt! = null) {try {cstmt.close ();        } catch (SQLException err) {cstmt = null;      }} try {if (conn! = null && conn.isclosed () = = False) Conn.close ();      } catch (SQLException err) {conn = null;  }}} public static void Main (string[] args) {new TestClass (); }}suggested FIX:Work Around:don ' t use, in defining JDBC called stored procedure parameters. For example, decimal instead of decimal (18,0). Fix:on Line 6836 of Com.mysql.jdbc.DatabaseMetaData theStatementForparsingThe parameter list is "list parselist = Stringutils.split (Parameterdef,", ", true);".  Since This was the problem this needs to be modified. Either add some intelligence to the argumentparsingThe parameter list is retrieved.
[7 APR 2005 18:49] Mark Matthews
Fixed for 3.1.8. You can test the fix with the nightly snapshot fromhttp://downloads.mysql.com/snapshots.php after 00:00 GMT April 8th. Thanks for your bug report!

SQL call stored procedure error internal "error when parsing callable statement metadata (missing parameter type)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.