Hi Miro,
I don't really understand why the method isClosed() doesn't work for your purpose. 
However, if you call 
"Connection.isClosed()" the driver will send a ping command for the current 
connection. This is exactly the same as evaluating the result of the dummy query 
"Select * from dual", but without the overhead of  
parsing a SQL command and generating a resultset etc.

> I believe select * from dual will work only if you are connecting in 
> oracle mode.
No, "select * from dual" will also work in internal mode.

Regards,
Marco

----------------------------------------------
Marco PASKAMP
SAP DB, Berlin

> -----Original Message-----
> From: Miroslav Halas [mailto:[EMAIL PROTECTED]
> Sent: Montag, 10. Mai 2004 12:24
> To: Paskamp, Marco
> Cc: [EMAIL PROTECTED]
> Subject: RE: JDBC Connection check statement
> 
> 
> Hi Marco,
> 
> thanks for your answer. Unfortunately this statement is 
> required by the 
> connection poll libraries (e.g. XAPool or DBCP) so isClosed 
> will not do it.
> 
> I believe select * from dual will work only if you are connecting in 
> oracle mode.
> 
> Miro
> 
> Paskamp, Marco wrote on 5/10/2004, 1:03 AM:
> 
>  > Hi,
>  > you can use "Connection.isClosed()". With MaxDB this will 
> send a ping
>  > request to the database server.
>  >
>  > public boolean isClosed()
>  >                  throws SQLExceptionTests to see if a Connection is
>  > closed.
>  > Returns:
>  > true if the connection is closed; false if it's still open
>  > Throws:
>  > SQLException - if a database access error occurs
>  >
>  > Regards,
>  > Marco
>  > ----------------------------------------------
>  > Marco PASKAMP
>  > MaxDB, Berlin
> 
> 
> 

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to