Use the appropriate getXXX and setXXX methods for the type

For performance reasons, use the recommended getXXX method when retrieving values, and use the recommended setXXX method when setting values for parameters. JDBC is permissive. It lets you use java.sql.ResultSet.getFloat to retrieve an int, java.sql.ResultSet.getObject to retrieve any type, and so on. (java.sql.ResultSet and java.sql.CallableStatement provide getXXX methods, and java .sql.PreparedStatement and java.sql.CallableStatement provide setXXX methods.) This permissiveness is convenient but expensive in terms of performance. The following table shows the recommended getXXX methods for given java.sql (JDBC) types, and their corresponding SQL types.


http://db.apache.org/derby/docs/10.8/tuning/ctunperf98197.html

你可能感兴趣的:(Use the appropriate getXXX and setXXX methods for the type)