How can I investigate the parameters to send into and receive from a database stored procedure?
Location: http://www.jguru.com/faq/view.jsp?EID=1187 Created: Nov 21, 1999 Author: Lennart Jorelid (http://www.jguru.com/guru/viewbio.jsp?EID=15) Use the method getProcedureColumns in interface DatabaseMetaData to probe a stored procedure for metadata. The exact usage is described in the code below. NOTE! This method can only discover parameter values. For databases where a returning ResultSet is created simply by executing a SELECT statement within a stored procedure (thus not sending the return ResultSet to the java application via a declared parameter), the real return value of the stored procedure cannot be detected. This is a weakness for the JDBC metadata mining which is especially present when handling Transact-SQL databases such as those produced by SyBase and Microsoft. public static void main(String[] args) throws Exception { // Load the database driver – in this case, we // use the Jdbc/Odbc bridge driver. Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”); // Open a connection t