JNDI configuration under Tomcat5.5 (transfer)

xiaoxiao2021-03-06  43

NDI is a very important standard in J2EE, usually in J2EE programming, Tomcat provides a method of using JNDI directly in JSP and ServelT, mainly through the DBCP connection pool, let me talk about me in Tomcat5.5 Methods of configuring and using JNDI. The object of this article is a reader who has been appreciated by J2EE, or has seen my BLOG: Tomcat's basic configuration instructions, first add the following statement in our own application web-infirectory:

Quote Resource Description

JNDI name of the reference resource

Quote the class name of the resource

Container

Then in the Tomcat directory / Conf/server.xml file

Elements, look at my BLOG: Tomcat's basic configuration instructions Add as the sub-elements:

Note, you have to copy your drive to common / lib, I use PointBase so I copy PBClient44.jar to Common / LIB (readers interested in PointBase can see my article PointBase database learning I also mentioned why I used the PointBase database as a explanation). Second, examples: The following is my hypothesis project acmeweb: Add a Web.xml in the corresponding program

.....

JDBC / ACMEDB

Javax.sql.datasource

Container

Then I'm modified in Server.xml:

I suggest you write the above content into an XML file, copy to conf / catalina /

/ Folder, if you don't understand, you can refer to my BLOG: Tomcat's basic configuration instructions and Tomcat's documentation.

转载请注明原文地址:https://www.9cbs.com/read-58945.html

New Post(0)