You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Hehl, Thomas" <Th...@acs-inc.com> on 2008/01/21 14:37:16 UTC

JDBC connection through JNDI

I wish to create a JDBC connection and store it in a JNDI tree for use by a
spring configuration file that usually runs my tomcat webapp. I'm trying to
figure out how tomcat creates the connection pool from my config file and
stores it in JNDI, but it is absolutely beyond me.

 

I've googled and looked through the source code and am nearly lost.

 

Thanks.

 

Thom Hehl
Sr. eJuror Architect

* Office (859) 277-8800 x 144

* Thomas.Hehl@acs-inc.com <ma...@acs-inc.com>  
ACS, Inc.

Government Solutions

1733 Harrodsburg Road
Lexington, KY 40504-3617

This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution is
prohibited. If you are not the intended recipient, please contact the sender
by reply e-mail and destroy all copies of the original message and notify
sender via e-mail at Thomas.Hehl@acs-inc.com
<ma...@acs-inc.com>  or by telephone at 859-277-8800 ext. 144.
Thank you.

 


Re: JDBC connection through JNDI

Posted by Mark Thomas <ma...@apache.org>.
Hehl, Thomas wrote:
> I wish to create a JDBC connection and store it in a JNDI tree for use by a
> spring configuration file that usually runs my tomcat webapp. I'm trying to
> figure out how tomcat creates the connection pool from my config file and
> stores it in JNDI, but it is absolutely beyond me.

Do you want to configure this, or understand how it works? Those are very 
different aims.

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JDBC connection through JNDI

Posted by Juha Laiho <Ju...@iki.fi>.
Hehl, Thomas wrote:
> I wish to create a JDBC connection and store it in a JNDI tree for use by a
> spring configuration file that usually runs my tomcat webapp. I'm trying to
> figure out how tomcat creates the connection pool from my config file and
> stores it in JNDI, but it is absolutely beyond me.

Hello,

here's one document for you to read - unless you've already seen it:
http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html#Adding%20Custom%20Resource%20Factories

That tells one part of JNDI resource construction. In the most cases you wouldn't
even need your own resource factory, but can rely on those supplied with Tomcat,

For JDBC resources, the documentation looks like it uses some heuristics to
choose org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory as the resource
factory to use (perhaps by looking at the "type" attribute of the resource
definition) and the other attributes from the resource definition are passed to the
factory class, which uses them to set properties on the resource to be created.

Perhaps, if you could elaborate on what exact information you're looking for (and
for what purpose), you might get more on-spot answers.
-- 
..Juha

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org