Help Center/
GaussDB/
Best Practices/
Best Practices for JDBC/
Best Practices for JDBC (Centralized Instances)/
Streaming Query/
Procedure/
Detailed Procedure
Updated on 2025-09-04 GMT+08:00
Detailed Procedure
- 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.
- Streaming query: Set fetchSize to Integer.MIN_VALUE before calling the executeQuery method of Statement and PreparedStatement.
- Result processing: Process the query results based on the actual services.
- 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.
Parent topic: Procedure
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot