Updated on 2025-09-04 GMT+08:00

Detailed Procedure

  1. Database connection: Set enableStreamingQuery to true, in addition to setting other connection parameters. For details, see "Application Development Guide > Development Based on JDBC > Development Procedure > Connecting to a Database" in Developer Guide.
  2. Streaming query: Set fetchSize to Integer.MIN_VALUE before calling the executeQuery method of Statement and PreparedStatement.
  3. Result processing: Process the query results based on the actual services.
  4. Resource release: Upon completion, release the result set, statement, connection, and other resources. It is advisable to use the try-with-resources syntax or the close method in the try-finally block to release resources.