[prev in list] [next in list] [prev in thread] [next in thread]
List: sapdb-general
Subject: RE: JDBC Connection check statement
From: "Paskamp, Marco" <marco.paskamp () sap ! com>
Date: 2004-05-10 10:39:58
Message-ID: 4E4F56128F599B47A3E47A5B13A7FF4F0ED342 () dewdfe21 ! wdf ! sap ! corp
[Download RAW message or body]
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:sapdb@bastafidli.com]
> Sent: Montag, 10. Mai 2004 12:24
> To: Paskamp, Marco
> Cc: maxdb@lists.mysql.com
> 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/maxdb?unsub=sapdb-general@progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic