import org.apache.commons.dbutils.DbUtils;
import org.sonar.core.persistence.Database;
+import org.sonar.core.persistence.dialect.MySql;
import java.sql.Connection;
import java.sql.PreparedStatement;
static SelectImpl create(Database db, Connection connection, String sql) throws SQLException {
PreparedStatement pstmt = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
- pstmt.setFetchSize(1000);
+ if (db.getDialect().getId().equals(MySql.ID)) {
+ pstmt.setFetchSize(Integer.MIN_VALUE);
+ } else {
+ pstmt.setFetchSize(1000);
+ }
return new SelectImpl(pstmt);
}
}