Hi,

Thanks for feedback.  If a SQLException can be returned then I could 
probably use that in the Java application to determine if an exception 
occurred.  Can you provide any guidance?

Thank you

Regards

Alan Farroll
Analyst Programmer
Finance and Corporate Services
Renfrewshire House
Cotton Street
Paisley
PA1 1HY

0141 618 7961
alan.farr...@renfrewshire.gov.uk
www.renfrewshire.gov.uk



From:   Christopher Schultz <ch...@christopherschultz.net>
To:     Tomcat Users List <users@tomcat.apache.org>
Date:   29/01/2013 17:11
Subject:        Re: JNDI Feedback



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Alan,

On 1/29/13 11:54 AM, alan.farr...@renfrewshire.gov.uk wrote:
> Running Tomcat 7.0.29 on Windows XP Professional Service Pack 3

Ready for a Microsoft upgrade cycle? The clock is ticking...

> I have been handed a project developed by a former colleague and I
> am still learning Java and Tomcat.

Welcome to the community!

> The project has 4 JNDI's set up

Nomenclature nit: that's "has 4 JNDI /resources/". JNDI itself is just
a directory interface where you stash stuff.

> 2 Oracle and 2 SQL Server with validation queries set up for the
> Oracle databases.  I want to set up validation queries on the
> JNDI's for SQL server and also have the JNDI provide feedback to
> the Java application if the database is down.

The only feedback you are going to get is (eventual) SQLExceptions.

> Can you advise how to do this please?  If not possible, then what
> is an alternative?

Obviously, you can set up a validationQuery in the 2 MS SQL Server
resources by just adding an appropriate query (e.g. "SELECT 1 FROM
DUAL" or whatever is appropriate in MS SQL Server) to the <Resource>
attributes.

Were you hoping to get some other behavior than just what
validationQuery already provides?

FYI if you are using Tomcat's default connection pool, then you are
using Apache commons-dbcp, whose configuration guide can be found
here: http://commons.apache.org/dbcp/configuration.html

That will explain all the configuration attributes you can use (right
in the XML) and what they all do.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEIAq0ACgkQ9CaO5/Lv0PBwvgCfd/QXbOkTEsCA4+dVG3GkhcYu
dOQAn0lAOIdxaok55TJCE5pu7jb+aR4t
=izRU
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




**********************************************************************

Renfrewshire Council Website - http://www.renfrewshire.gov.uk

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they  are addressed. If 
you have received this email in error please notify the system manager.

Renfrewshire Council may, in accordance with  the Telecommunications(Lawful 
Business Practice) (Interception of Communications) Regulations 2000, intercept 
e-mail messages for the purpose of monitoring or keeping a record of 
communications on the Council's system. If a message contains inappropriate 
dialogue it will automatically be intercepted by the Council's Internal Audit 
section who will decide whether or not the e-mail should be onwardly 
transmitted to the intended recipient(s).

This footnote also confirms that this email message has been swept by Sophos 
for the presence of computer viruses.

**********************************************************************


Reply via email to