Mysql fetch size problems by default, MySQL's JDBC driver will read all rows at once, which is generally the best, this reduces the communication overhead of the Client-Server. However, there is also a problem. When the database query results are very large, especially when not all can be put into the memory, it will produce performance problems. Originally, the JDBC api has the fetchSize setting method on Connection, Statement, and ResultSet, but the JDBC driver of MySQL does not support it, no matter how you set fetchSize, all ResultSet reads data from Serv er at a time. There are also many such problems on the official MySQL Forum. The solution is summarized as follows: 1. mySQL version 5.0 or later, MySQL JDBC driver updated to the latest version (at least 5.0 or later) 2. statement must be TYPE_FORWARD_ONLY, And the concurrency level is CONCUR_READ_ONLY (that is, the default parameter for creating Statem ent) 3. select one of the following two statements: 1 ). statement. setFetchSize (Integer. MIN_VALUE); 2 ). (com. mysql. jdbc. statement) stat ). enableStreamingResults (); this will read data from the Server row by row, so the communication overhead is high, but the memory problem can be solved. The official statement is that fetchSize is not supported by MySQL, but not by MySQL itself. The commercial database Oracle or DB2 both support fetchSize, so we can see that the two have different considerations.