Published Date: 2025-07-02 Version: V2.4.15
Version overview
JDBC V2.4.15 introduces multiple parameters to enhance compatibility with MySQL and Oracle. In MySQL mode, it introduces the useLocalSessionState parameter to control whether the JDBC client uses cached session state, reducing the frequency of queries sent to the OBServer. In Oracle mode, it adds the lowercaseRoutinesInMetadata parameter to control whether the names returned by getProcedures and getFunctions should be in lowercase. Additionally, the Set/Get ClientInfo interface has been optimized to use local caching, minimizing the need for frequent requests to the OBServer, thus reducing database resource overhead.
New features
- Optimize the set/get client info interface to use local cache, reducing the number of frequent requests to OBServer and lowering database resource overhead.
- MySQL tenant
- Added the
useLocalSessionStateparameter to control whether the JDBC client uses cached session states (such as transaction mode, auto-commit status, and current database) to avoid frequent queries to OBServer. If the parameter value is False, queries are always sent. If the value is True and the session state has not changed, no requests are sent. Otherwise, requests are sent. This parameter was not available in JDBC versions earlier than V2.4.15. The default value is True, as in earlier versions, commands were sent to the server only when the session state changed.
- Added the
- Oracle tenant
- The parameter
lowercaseRoutinesInMetadatahas been added to control whether to allow thegetProceduresorgetFunctionsinterface to retrieve procedure or function metadata with the name condition in lowercase. The default value is True, and it supports lowercase. - In Oracle mode, only
binary_doubleis a real double type, and all other ordinary double types should be converted to number types. Currently, thesetDoubleinterface in JDBC sends data of the double type, which cannot be distinguished from thesetBinary_doubleinterface. In JDBC V2.4.15, the serialization data type of thesetDoubleinterface is changed to Number, differentiating it fromsetBinary_double. - Add the
convertNoneNanoSecsToDateparameter to control whether to convert a timestamp field that contains values of different precisions to a date field.
- The parameter
URL parameter changes
Add the following URL parameter:
Option name |
Status |
Default value |
Description |
|---|---|---|---|
oracleXaPrepareThrowException |
Added | false | If dbms_xa.xa_prepare returns a value other than 0 or 3, an exception is thrown. |
useLocalSessionState |
New | true | Controls whether the driver uses local caching of session state (such as transaction mode, auto-commit status, current database, etc.) to avoid frequent queries to the server to obtain these states. The default value for MySQL-JDBC is false. |
convertNoneNanoSecsToDate |
Added | true | In Oracle mode, whether to convert the parameter values of the setTimestamp interface into Date objects when the values have no nanoseconds. |
oracleUseNumberForSetDouble |
Added | false | For an Oracle tenant, whether to serialize setDouble to a number type. |
lowercaseRoutinesInMetadata |
Added | true | Specifies whether to return the name in lowercase for routines such as procedure and function, when you obtain the metadata in the Oracle tenant. |
Bug fix
The main issues fixed in this iteration are listed below:
- Fixed an issue where, in Oracle mode, a connection error would occur if the time zone table was not imported.
- Fixed a problem where the values of output parameters were incorrect when stored procedures were called across users without registering output parameters.
- Optimize the implementation of the
getcolumnsinterface to improve execution performance. - Fixed an issue where, when the PS cache is enabled and the cursor result set is used, if the data from the previous request is not fully fetched, the same PS is used to fetch new data, causing an abnormal state of the previously fetched data.
- Fixed a rare issue where a type conversion failure can occur when an array contains nested CLOB data types.
- Resolved an issue where frequently opening and closing PS and not closing the pstmt created for cursor results would lead to cursor limit exceeded.
- Fixed the issue where, in a dual-stack (IPv4/IPv6) environment, the PS does not close correctly when an array binding execution fails.
- Fixed an issue where
ResultSet.isAfterLast()returned an incorrect result when only one record exists in the database, and the protocol and cursor are used. - Fixed the issue where
getFunctionColumnsreturns an incorrect value when the function comment is a single string. - Fixed an issue where setting the parameter
jdbcCompliantTruncation=falseresults in an error when data truncation occurs. - Fixed the error when using public synonyms across users.
- Fix an issue where, in MySQL mode, when
rewriteBatchedStatementsis set to true and anon duplicate key updatestatement contains\n, the result ofgetGeneratedKeysis incorrect. - Fixed an issue in which
executeBatchreturned an incorrect value when two rows of values were inserted with theON DUPLICATE KEY UPDATEstatement. - Fix the error of unknown complex data type when anonymous arrays are nested in the JDBC driver.
- Fixed an issue where an incorrect statement was generated when the
setBlobmethod was called withuseServerPrepStmts=truein MySQL mode. - Fixes the issue where the
releaseSavepointinterface in Oracle mode is incompatible with Oracle, leading to a connection break in hikariCp. - Fixed the issue where, in Oracle mode, the incorrect registration of OUT parameters causes the get method to retrieve incorrect result values.
- Fixed the issue where the client incorrectly calculates the number of rows returned by a PL update statement.
