Question Details

No question body available.

Tags

java jdbc mysql-connector oceanbase

Answers (1)

Accepted Answer Available
Accepted Answer
July 24, 2026 Score: 1 Rep: 400 Quality: High Completeness: 60%

This is a known issue caused by a compatibility conflict between server-side PreparedStatement handling in MySQL Connector/J 9.5.0 and distributed or MySQL-compatible databases (such as OceanBase).

The cause:

When using the useServerPrepStmts=true configuration (specified in your connection URL), the driver relies heavily on binary protocol execution commands (COMSTMTPREPARE and COMSTMTEXECUTE) processed on the database server. Version 9.5.0 introduced stricter changes regarding query rendering and structural state validation. If you connect to a database that behaves largely like MySQL, but employs a slightly different binary protocol response structure, the driver fails to correctly parse incoming result packets. Consequently, it returns zero rows without notification instead of throwing an error.

Statement objects work as usual because they completely bypass this binary protocol, instead sending raw text SQL via simple text commands.