I am using hive jdbc 1.0 in my java application to create connection with hive server and execute query. I want to set the idle hive connection timeout from java code. Like say, user first creates the hive connection, and if the hive connection remains idle for next 10 minutes, then this connection object should get expired. If user uses this same connection object after 10 minutes for executing query, then hive jdbc should throw error. Can you please tell me the way to achieve this through java code.
I know there is a property *hive.server2.idle.session.timeout *in hive, but I don't know whether this is the right property required to be set from java code or there is some other property. I tried setting this property in jdbc connection string but it did not worked. try { Class.forName("org.apache.hive.jdbc.HiveDriver"); } catch (ClassNotFoundException e) { LOG.error(ExceptionUtils.getStackTrace(e)); } String jdbcurl = " *jdbc:hive2://localhost:10000/idw?hive.server2.idle.session.timeout=1000ms";* Connection con; con = DriverManager.getConnection(jdbcurl,"root",""); Thread.sleep(3000); Now below I am using connection object, hive jdbc should throw error here as I used connection object after 3000 ms but I had set the idle timeout as 1000ms but hive jdbc had not thrown error ResultSet rs = con.createStatement().executeQuery("select * from idw.emp"); Need help on this.