hi Ahmed, JAR files are not "loaded" by Tomcat. A jar file is just a container of classes, the classes are loaded by the JVM when the code makes reference to them. If you specify a <Resource> on your context.xml, then Tomcat will look for those classes (the driverClassName), but that does not mean that a connection to the database is established at that point in time. It only means that the driver has been loaded. Your application is responsible to ask for a connection whenever it wishes.
On Sat, Dec 5, 2009 at 7:17 AM, ahmed kasim <callka...@yahoo.com> wrote: > Hi, > > I have few jars which need to get loaded only when the war file is getting > loaded or when the request comes, to be more clear I have some jar which is > having connection to DB, if I specify in my context.xml file it is getting > loaded when the server getting started up initially, so I want to avoid this > and make it when my war file gets loaded the db connection should get > loaded. > > <Resource name="jdbc/DB2DS" auth="Container" type="javax.sql.DataSource" > driverClassName="com.ibm.db2.jcc.DB2Driver" > url="jdbc:db2://localhost:50000/SPARK" username="db2admin" > password="d...@dmin" maxActive="20" maxIdle="10" maxWait="-1"/> > > I have three jar file specified for Resource , if i place jar file it is > getting loaded and server starts up looking for connection with db. > > How can I avoid server starting time look up and make it available only > when I deploy the war file. > > many thanks, > Kasim > > >