After all operations are completed, the connection to the database must be closed.
You can close the connection by using the close method of the Connection object:
conn.close();
Note
Usually, the close method is placed in the finally clause.
Meet OceanBase AI Lakebase, the unified database for operational data, real-time analytics, and AI.
Meet OceanBase AI Lakebase, the unified database for operational data, real-time analytics, and AI. Explore ->
OceanBase Connector/J
Download PDF
After all operations are completed, the connection to the database must be closed.
You can close the connection by using the close method of the Connection object:
conn.close();
Usually, the close method is placed in the finally clause.