My guess: validate the Connection by executing "SELECT 1" or something similar. If it succeeds, the connection (and the server) must be up.

Gili

On 10/12/2011 9:19 AM, the nigga wrote:
Hello

There any way that knows if H2 database is online ?
I am use this to connect in my H2 server.

public static Connection getConnection() throws SQLException{
         try {

             Class.forName("org.h2.Driver");
             return DriverManager.getConnection("jdbc:h2:tcp://
192.168.1.100:9001/db/
iguana","sa","mypassword");
         } catch (ClassNotFoundException e) {
             JOptionPane.showMessageDialog(null,
e.getMessage());
             throw new SQLException();
         }
     }

How to know if server is online ?

thanks.


--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to