public static void setFetchSize(PreparedStatement pstmt, int fetchSize) {
        if (pstmt_fetchSizeSupported) {
            try {
                pstmt.setFetchSize(fetchSize);
            }
            catch (Throwable t) {
                // Ignore. Exception may happen if the driver doesn't support
                // this operation and we didn't set meta-data correctly.
                // However, it is a good idea to update the meta-data so that
                // we don't have to incur the cost of catching an exception
                // each time.
                Log.debug("Disabling JDBC method pstmt.setFetchSize(fetchSize).", t);
                pstmt_fetchSizeSupported = false;
            }
        }
    }
Sets the number of rows that the JDBC driver should buffer at a time.
The operation is automatically bypassed if Openfire knows that the
the JDBC driver or database doesn't support it.

@param pstmt the PreparedStatement to set the fetch size for.
@param fetchSize the fetchSize.
xmppserver/src/main/java/org/jivesoftware/database/DbConnectionManager.java