Skip to main content

Posts

Showing posts with the label ParameterMetaData

How to Use ParameterMetaData to Learn Parameter Information?

-- In the following example, it shows various methods of the ParameterMetaData object are used to display information about the type and mode of the parameters that are contained within a stored procedure. import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.DriverManager; import java.sql.ParameterMetaData; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.sql.Types; public class JDBCPrepareMetaData { private static final String DBURL = "jdbc:mysql://localhost:3306/mydb?user=usr&password=sql" +"&useUnicode=true&characterEncoding=UTF-8"; private static final String DBDRIVER = "org.gjt.mm.mysql.Driver"; static { try { Class.forName(DBDRIVER).newInstance(); } catch (Exception e){ e.p...