I want to test the connection so I am using the query: 'SELECT 1 FROM dual' to compare the value returned.
ResultSet rs = stmt.executeQuery("SELECT 1 FROM dual");
on doing rs.next() the exception thrown is:
java.sql.SQLException: Closed Connection: next
How can I get rs.getString(1) as 1 by executing the query?