Re: Tomcat Datasource , can we define them in war file (whithout accessing to Admin console)?
On 12/26/05, Legolas Woodland [EMAIL PROTECTED] wrote: Is it possible to make a data-source without admin console ? I mean by defining the data-source in web.xml or in Context.xml (i think i read somewhere that we could put context.xml into meta-inf folder and it will act like Context definition in admin console). Yes, you can define your datasource in the application's META-INF/context.xml file. There are examples on the web, but I can provide an example if you contact me directly. I'd post a link but I'm writing this in a hurry. is it mandatory that Tomcat shared library folder contain my database jdbc driver to have data-source ? I mean can we bundle , our JDBC driver inside war file and define the data-source in war file too ? I've not tried that but have assumed it's possible. -- Bruce Tong
Re: Tomcat Datasource , can we define them in war file (whithout accessing to Admin console)?
Like Bruce said, you can define a DataSource as part of your application's context. It's the same format as the context definition in server.xml except it's deployed with your application as an XML file (context.xml) inside the META-INF directory of the WAR. Here's a link to explain how to do it: http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-examples-howto.html They don't go into using context.xml but the same instructions can be applied to using the context.xml. On 12/26/05, Legolas Woodland [EMAIL PROTECTED] wrote: Hi Thank you for reading my post. Is it possible to make a data-source without admin console ? I mean by defining the data-source in web.xml or in Context.xml (i think i read somewhere that we could put context.xml into meta-inf folder and it will act like Context definition in admin console). is it mandatory that Tomcat shared library folder contain my database jdbc driver to have data-source ? I mean can we bundle , our JDBC driver inside war file and define the data-source in war file too ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Virtually, Andre Van Klaveren Architect III, SCP Global Public Sector Unisys Corporation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Datasource , can we define them in war file (whithout accessing to Admin console)?
Khawaja Shams wrote: Hello, I am assuming that you are trying to define this datasource in order to do application server managed connection pooling. The closest I have done to what you described is declare a datasource as a global resource in the server.xml and refer to it in context definition. You can define a new context in the $CATALINA_HOME/conf/Catalina/localhost/APPNAME.xml. Here is an example: ?xml version=1.0 encoding=UTF-8? Context path=/son ResourceLink name=jdbc/teamDB global=jdbc/teamDB type=javax.sql.DataSource / /Context I want to create a data source to have a application server managed pool of connection. but the problem is that i have no access to tomcat installation folder , so i can not change anythin in tomcat installation . they just allows to upload a war file. However, I still needed to put the jdbc jar file in the common/lib. I am not completely sure about this, but for application server to manage your datasource, one needs to make the proper jar file available to the app server by putting it in the common/lib as it will not look inside each deployed directory to perform application independent tasks. I am also curious to know if someone has found a way around this. A connection pool is application is application independent ? but i want the connection pool just for my own application. I will be happy if any one can tell me a trick to have application server managed pool without changing tomcat installation stuff. Best Regards, Khawaja Shams On 12/26/05, Legolas Woodland [EMAIL PROTECTED] wrote: Hi Thank you for reading my post. Is it possible to make a data-source without admin console ? I mean by defining the data-source in web.xml or in Context.xml (i think i read somewhere that we could put context.xml into meta-inf folder and it will act like Context definition in admin console). is it mandatory that Tomcat shared library folder contain my database jdbc driver to have data-source ? I mean can we bundle , our JDBC driver inside war file and define the data-source in war file too ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat Datasource , can we define them in war file (whithout accessing to Admin console)?
Hi Thank you for reading my post. Is it possible to make a data-source without admin console ? I mean by defining the data-source in web.xml or in Context.xml (i think i read somewhere that we could put context.xml into meta-inf folder and it will act like Context definition in admin console). is it mandatory that Tomcat shared library folder contain my database jdbc driver to have data-source ? I mean can we bundle , our JDBC driver inside war file and define the data-source in war file too ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Datasource , can we define them in war file (whithout accessing to Admin console)?
Hello, I am assuming that you are trying to define this datasource in order to do application server managed connection pooling. The closest I have done to what you described is declare a datasource as a global resource in the server.xml and refer to it in context definition. You can define a new context in the $CATALINA_HOME/conf/Catalina/localhost/APPNAME.xml. Here is an example: ?xml version=1.0 encoding=UTF-8? Context path=/son ResourceLink name=jdbc/teamDB global=jdbc/teamDB type=javax.sql.DataSource / /Context However, I still needed to put the jdbc jar file in the common/lib. I am not completely sure about this, but for application server to manage your datasource, one needs to make the proper jar file available to the app server by putting it in the common/lib as it will not look inside each deployed directory to perform application independent tasks. I am also curious to know if someone has found a way around this. Best Regards, Khawaja Shams On 12/26/05, Legolas Woodland [EMAIL PROTECTED] wrote: Hi Thank you for reading my post. Is it possible to make a data-source without admin console ? I mean by defining the data-source in web.xml or in Context.xml (i think i read somewhere that we could put context.xml into meta-inf folder and it will act like Context definition in admin console). is it mandatory that Tomcat shared library folder contain my database jdbc driver to have data-source ? I mean can we bundle , our JDBC driver inside war file and define the data-source in war file too ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]