title: Connection getting closed when the connection is idle for more than 5 minutes in oracle jdbc thin connection
body: <p>This code snippet executes a query then program sleeps for 5 minutes and after it returns false for isValid method.
  uses jdbc thin client.
  max_idle_time is set to 0 on db .
  For local machine DB Instance, connection is not getting closed. So I am guessing, it must be related to my network. Any help would be greatly appreciated.</p>
  
  <pre><code>package com.oracle.jdbc.test;
  import java.sql.*;  
  public class JDBCTest {
  
      public static void main(String args[]){  
      try{  
      //step1 load the driver class  
      Class.forName("oracle.jdbc.driver.OracleDriver");  
  
      //step2 create  the connection object  
      Connection con=DriverManager.getConnection(  
      "jdbc:oracle:thin:@****","****","****");  
  
      //step3 create the statement object  
      Statement stmt=con.createStatement();  
  
      //step4 execute query  
      ResultSet rs=stmt.executeQuery("select 1 from dual");  
      while(rs.next())  
      System.out.println(rs.getInt(1));  
  
      //step5 close the connection object  
      Thread.sleep(300000);
      System.out.println(con.isValid(1));
      stmt.executeQuery("select 1 from dual");
  
      }catch(Exception e){ System.out.println(e);}  
  
      }  
  }
  
  enter code here
  </code></pre>