Connection conn = DriverManager.getConnection(url, props); PreparedStatement st = conn.prepareStatement("INSERT INTO test VALUES('xxx')"); st.setQueryTimeout(5); st.execute(); --
But if I set autoCommit to false, this code timeouts after 30 seconds on read timeout: