Why Should You Use ParameterMetadata Wisely? JDBC

You should not invoke the PreparedStatement.getParameterMetaData() method very often. Calling this method might slow the performance of your database application. This method call requires a round-trip to the database server to get metadata information about the number of dynamic parameters, data types, and other useful information. If possible, cache the ParameterMetadata objects extracted from PreparedStatement(s). Caching this type of data will improve your application’s performance. Note that implementation of the method PreparedStatement.getParameterMetaData() is driver dependent (one implementation might get all parameters in one call versus another driver, which might get metadata per parameter— the latter one will require multiple trips to database server).

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

JDBC Topics