标签:
I’ve recommended using the
setFetchSize() method here on the (prepared) statement
object, but that method also exists on the ResultSet interface. In either case, the size is
just a hint. The JDBC driver is free to ignore that value, or round it to some other value,
or anything else it wants to do. There are no assurances either way, but setting the value
before the query is executed is more likely to result in the hint being honored.
Some JDBC drivers also allow you to set a default fetch size when the connection is
created by passing a property to the getConnection() method of the DriverManager.
Consult your vendor’s documentation if that path seems easier to manage.
Java Performance: The Definitive Guide
by Scott Oaks
Copyright ? 2014 Scott Oaks. All rights reserved.
Printed in the United States of America.
java之Database Performance Best Practices
标签:
原文地址:http://blog.csdn.net/doctor_who2004/article/details/51416131