Document Type | Troubleshooting
Category | Interface/Integration
Applicable Product Version | 6FS07
Document Number | TIITS008
Issue
When connecting to the DB via Tibero JDBC driver using HikariCP in an Azure environment, the error "Driver does not support get/set network timeout for connections." occurs.
Cause
Support for the setNetworkTimeout() / getNetworkTimeout() methods varies depending on the Tibero JDBC driver version, which can cause errors when setting network timeout.
The behavior by each driver is as follows.
Driver | Result |
|---|---|
tibero6-jdbc.jar | The get/setNetworkTimeout() methods are not implemented, so this feature cannot be used. |
tibero7-jdbc.jar | The setNetworkTimeout() method exists in the interface but is not actually implemented, so an error occurs upon execution. Execution error example: Exception in thread "main" java.lang.AbstractMethodError: com.tmax.tibero.jdbc.driver.TbConnection.setNetworkTimeout(Ljava/util/concurrent/Executor;I)V at TiberoNetworkTimeoutTest.main(TiberoNetworkTimeoutTest.java:16) |
tibero7-jdbc-18.jar | Both setNetworkTimeout() and getNetworkTimeout() methods operate normally. โป Requires JDK 1.8 or higher |
Solutions
Use tibero7-jdbc-18.jar (JDK 1.8 or higher), as both setNetworkTimeout() and getNetworkTimeout() work properly with this version.
NoteThe test method is as follows.1. Create java filevi /home/tibero/tibero7/client/lib/jar/TiberoNetworkTimeoutTest.javaimport java.sql.*; import java.util.concurrent.*; public class TiberoNetworkTimeoutTest { public static void main(String[] args) { String url = "jdbc:tibero:thin:@192.168.29.209:8629:tibero"; String user = "sys"; String password = "tibero"; System.out.println("Step 1: Attempting DB connection..."); try (Connection conn = DriverManager.getConnection(url, user, password)) { System.out.println("Step 2: DB connection successful!"); Executor executor = Executors.newSingleThreadExecutor(); conn.setNetworkTimeout(executor, 5000); System.out.println("Step 3: setNetworkTimeout set successfully!"); int timeout = conn.getNetworkTimeout(); System.out.println("Current Network Timeout value: " + timeout); } catch (SQLFeatureNotSupportedException e) { System.out.println("getNetworkTimeout() is not supported."); } catch (Exception e) { System.out.println("Exception occurred:"); e.printStackTrace(); } } }2. Compile$ javac TiberoNetworkTimeoutTest.java3. Run$ java -cp .:tibero7-jdbc-18.jar TiberoNetworkTimeoutTestStep 1: Attempting DB connectionโฆ Step 2: DB connection successful! Step 3: setNetworkTimeout set successfully! Current Network Timeout value: 5000This does not run with tibero7-jdbc-14.jar / tibero7-jdbc.jar files.
Step 1: Attempting DB connectionโฆ Step 2: DB connection successful! Exception in thread "main" java.lang.AbstractMethodError: com.tmax.tibero.jdbc.driver.TbConnection.setNetworkTimeout(Ljava/util/concurrent/Executor;I)V at TiberoNetworkTimeoutTest.main(TiberoNetworkTimeoutTest.java:16)