How Do You Get ParameterMetadata from Stored Procedures (MySQL)? JDBC

The current production version of MySQL does not support stored procedures, but the Beta version of MySQL (5.0+ version) does. For details on stored procedures, refer to MySQL’s documentation and reference manuals.

Next, let’s set up a stored procedure (called simpleproc), and invoke it using a CallableStatement. Then, we’ll invoke CallableStatement.getParameterMetaData() to get the stored procedure’s parameters metadata.

First, define a very simple stored procedure in MySQL that has one output parameter:

As you can see, MySQL’s JDBC driver does not support the Callable Statement. getParameter MetaData() method. There is another way that you can get the metadata information on a stored procedure’s parameters: you can use Connection. getMetaData(), which will give you a Database MetaData object. Then, using that Database MetaData object, you can get the signature of all stored procedures by using the following methods:



Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

JDBC Topics