title: What is the best way to 'ping' a database via JDBC?
body: <p>I'm trying to determine the best way to ping a database via JDBC. By 'best' I mean fast and low overhead. For example, I've considered executing this:</p>
  
  <pre><code>"SELECT 1 FROM DUAL"
  </code></pre>
  
  <p>but I believe the DUAL table is Oracle-specific, and I need something more generic.</p>
  
  <p>Note that <code>Connection</code> has an <code>isClosed()</code> method, but the javadoc states that this cannot be used to test the validity of the connection.</p>