You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Felipe Schnack <fe...@ritterdosreis.br> on 2003/05/03 22:23:02 UTC
connection pool - it's standard?
I was wondering if the way tomcat handles connection pools is standanrd. I
mean, If I write my application using tomcat's pool, that I access thru JNDI,
etc, I can use my application in another container?
/~\ The ASCII Felipe Schnack (felipes@ritterdosreis.br)
\ / Ribbon Campaign Analista de Sistemas
X Against HTML Cel.: 51-91287530
/ \ Email! Linux Counter #281893
Centro Universitário Ritter dos Reis
http://www.ritterdosreis.br
ritter@ritterdosreis.br
Fone: 51-32303341
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: connection pool - it's standard?
Posted by Kwok Peng Tuck <pe...@makmal.net>.
Sort of. If you are using Sun One App server then you also need to add
an additional xml file in the WEB-INF directory. It's mainly related to
the resource definition. Took a while to figure it out, but then again
I didn't have any manuals to fall back on :( . This may not be the case
for other app servers :) .
Felipe, you don't reall need to change anything as far as your code is
concerned.
Tim Funk wrote:
> Yes (I think)
>
> -Tim
>
> Felipe Schnack wrote:
>
>> I was wondering if the way tomcat handles connection pools is
>> standanrd. I
>> mean, If I write my application using tomcat's pool, that I access
>> thru JNDI,
>> etc, I can use my application in another container?
>>
>> /~\ The ASCII Felipe Schnack (felipes@ritterdosreis.br) \ /
>> Ribbon Campaign Analista de Sistemas X Against HTML Cel.:
>> 51-91287530 / \ Email! Linux Counter #281893
>> Centro Universitário Ritter dos Reis http://www.ritterdosreis.br
>> ritter@ritterdosreis.br Fone: 51-32303341
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: connection pool - it's standard?
Posted by Bret Hart <im...@yahoo.com>.
Thanks Tarun. I would try out myself when I have time
:)
Lawrence
--- Tarun Ramakrishna Elankath <ta...@webkadai.com>
wrote:
> The datasource connection pool configuration is
> _similar_ for other
> vendors. If you have configured a connection pool in
> Tomcat, then you
> would have changed 3 files: the context
> configuration (in server.xml or
> a separate context.xml) where the JNDI datasource is
> defined, the
> web.xml where the JNDI resource is referenced and
> finally in your java
> code where the JNDI resource is looked up.
>
> Your java code and web.xml will certainly not
> change. But the details of
> context configuration where the JDNI resource is
> defined is specific to
> each container. That'st the only bit you would need
> to change.
>
> Yet another string that might possibly change is the
> JNDI lookup string
> prefix. But you may migrate the same to a properties
> file.
>
> PLUS: Tomcat's connection pool configuration isn't
> complex. Its just a
> bit tedious. But don't worry, you'll soon get the
> hang of it. I have
> done it 10 times myself now for different databases.
> Just make sure of
> the following:
> 1)First check using Class.forName and
> DriverManager.getConnection that
> you able to establish a simply database connection
> to your db server.
> 2)Check that your driver is in a _jar_ (not zip
> file) and present in
> common/lib. For example the oracle thin driver comes
> in a classes12.zip
> file which must be renamed to a .jar file and put in
> common/lib.
> 2)Make sure that your resource definition name and
> the resource
> reference name within the Context element and
> web.xml respectively are
> identical.
> 3) Use a lookup of the form:
> java:comp/env/<resource-name> in your java
> code.
>
> That's all!
>
> For examples take a look at:
>
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
>
> Cheers,
> Tarun
>
>
> On Sun, 2003-05-04 at 09:29, Bret Hart wrote:
> > Talking about connection pool, do you think use
> > tomcat's pool is better? As im just using the
> > connection pool java downloaded from web, and I
> see
> > the tomcat pool 's installation/setup process is
> quite
> > complex, or do anyone can give me some ref of
> tomcat
> > pool setup guides?
> > thanks
> >
> > --- Tim Funk <fu...@joedog.org> wrote:
> > > Yes (I think)
> > >
> > > -Tim
> > >
> > > Felipe Schnack wrote:
> > > > I was wondering if the way tomcat handles
> > > connection pools is standanrd. I
> > > > mean, If I write my application using tomcat's
> > > pool, that I access thru JNDI,
> > > > etc, I can use my application in another
> > > container?
> > > >
> > > > /~\ The ASCII Felipe Schnack
> > > (felipes@ritterdosreis.br)
> > > > \ / Ribbon Campaign Analista de Sistemas
> > > > X Against HTML Cel.: 51-91287530
> > > > / \ Email! Linux Counter #281893
> > > >
> > > > Centro Universit嫫io Ritter dos Reis
> > > > http://www.ritterdosreis.br
> > > > ritter@ritterdosreis.br
> > > > Fone: 51-32303341
> > >
> > >
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > > tomcat-user-help@jakarta.apache.org
> > >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Search - Faster. Easier. Bingo.
> > http://search.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> >
> >
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: connection pool - it's standard?
Posted by Kwok Peng Tuck <pe...@makmal.net>.
http://localhost/myapp/servlet/[servlet name]
If you can call your servlet without mapping them out then your servlet
invoker is enabled.
Easiest way is to just check the web.xml of your webapp.
Bret Hart wrote:
>How do I know my servlet invoker is enabled or
>not?thanks
>
>--- Kwok Peng Tuck <pe...@makmal.net> wrote:
>
>
>>No, if the servlet invoker is enabled then you don't
>>need to do that.
>>By default I think the servlet is invoker is
>>disabled that's why you have
>>to map your servlets.
>>
>>Bret Hart wrote:
>>
>>
>>
>>>Secondly, I need to map every single JAVA sevlet in
>>>the web.xml below?
>>>
>>>
>>>
>>><?xml version="1.0" encoding="ISO-8859-1"?>
>>> <!DOCTYPE web-app PUBLIC
>>> "-//Sun Microsystems, Inc.//DTD Web Application
>>>2.3//EN"
>>> "http://java.sun.com/dtd/web-app_2_3.dtd">
>>><web-app>
>>> <description>MySQL Test App</description>
>>> <resource-ref>
>>> <description>DB Connection</description>
>>> <res-ref-name>jdbc/TestDB</res-ref-name>
>>> <res-type>javax.sql.DataSource</res-type>
>>> <res-auth>Container</res-auth>
>>> </resource-ref>
>>></web-app>
>>>
>>>
>>>Thanks
>>>
>>>
>>>--- Tarun Ramakrishna Elankath <ta...@webkadai.com>
>>>wrote:
>>>
>>>
>>>
>>>
>>>>The datasource connection pool configuration is
>>>>_similar_ for other
>>>>vendors. If you have configured a connection pool
>>>>
>>>>
>>in
>>
>>
>>>>Tomcat, then you
>>>>would have changed 3 files: the context
>>>>configuration (in server.xml or
>>>>a separate context.xml) where the JNDI datasource
>>>>
>>>>
>>is
>>
>>
>>>>defined, the
>>>>web.xml where the JNDI resource is referenced and
>>>>finally in your java
>>>>code where the JNDI resource is looked up.
>>>>
>>>>Your java code and web.xml will certainly not
>>>>change. But the details of
>>>>context configuration where the JDNI resource is
>>>>defined is specific to
>>>>each container. That'st the only bit you would
>>>>
>>>>
>>need
>>
>>
>>>>to change.
>>>>
>>>>Yet another string that might possibly change is
>>>>
>>>>
>>the
>>
>>
>>>>JNDI lookup string
>>>>prefix. But you may migrate the same to a
>>>>
>>>>
>>properties
>>
>>
>>>>file.
>>>>
>>>>PLUS: Tomcat's connection pool configuration isn't
>>>>complex. Its just a
>>>>bit tedious. But don't worry, you'll soon get the
>>>>hang of it. I have
>>>>done it 10 times myself now for different
>>>>
>>>>
>>databases.
>>
>>
>>>>Just make sure of
>>>>the following:
>>>>1)First check using Class.forName and
>>>>DriverManager.getConnection that
>>>>you able to establish a simply database connection
>>>>to your db server.
>>>>2)Check that your driver is in a _jar_ (not zip
>>>>file) and present in
>>>>common/lib. For example the oracle thin driver
>>>>
>>>>
>>comes
>>
>>
>>>>in a classes12.zip
>>>>file which must be renamed to a .jar file and put
>>>>
>>>>
>>in
>>
>>
>>>>common/lib.
>>>>2)Make sure that your resource definition name and
>>>>the resource
>>>>reference name within the Context element and
>>>>web.xml respectively are
>>>>identical.
>>>>3) Use a lookup of the form:
>>>>java:comp/env/<resource-name> in your java
>>>>code.
>>>>
>>>>That's all!
>>>>
>>>>For examples take a look at:
>>>>
>>>>
>>>>
>>>>
>>>>
>>http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
>>
>>
>>>
>>>
>>>
>>>
>>>>Cheers,
>>>>Tarun
>>>>
>>>>
>>>>On Sun, 2003-05-04 at 09:29, Bret Hart wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>Talking about connection pool, do you think use
>>>>>tomcat's pool is better? As im just using the
>>>>>connection pool java downloaded from web, and I
>>>>>
>>>>>
>>>>>
>>>>>
>>>>see
>>>>
>>>>
>>>>
>>>>
>>>>>the tomcat pool 's installation/setup process is
>>>>>
>>>>>
>>>>>
>>>>>
>>>>quite
>>>>
>>>>
>>>>
>>>>
>>>>>complex, or do anyone can give me some ref of
>>>>>
>>>>>
>>>>>
>>>>>
>>>>tomcat
>>>>
>>>>
>>>>
>>>>
>>>>>pool setup guides?
>>>>>thanks
>>>>>
>>>>>--- Tim Funk <fu...@joedog.org> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Yes (I think)
>>>>>>
>>>>>>-Tim
>>>>>>
>>>>>>Felipe Schnack wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> I was wondering if the way tomcat handles
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>connection pools is standanrd. I
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>mean, If I write my application using tomcat's
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>pool, that I access thru JNDI,
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>etc, I can use my application in another
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>container?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>/~\ The ASCII Felipe Schnack
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>(felipes@ritterdosreis.br)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>\ / Ribbon Campaign Analista de Sistemas
>>>>>>> X Against HTML Cel.: 51-91287530
>>>>>>>/ \ Email! Linux Counter #281893
>>>>>>>
>>>>>>>Centro Universit嫫io Ritter dos Reis
>>>>>>>http://www.ritterdosreis.br
>>>>>>>ritter@ritterdosreis.br
>>>>>>>Fone: 51-32303341
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>---------------------------------------------------------------------
>>
>>
>>>
>>>
>>>
>>>
>>>>>>To unsubscribe, e-mail:
>>>>>>tomcat-user-unsubscribe@jakarta.apache.org
>>>>>>For additional commands, e-mail:
>>>>>>tomcat-user-help@jakarta.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>__________________________________
>>>>>Do you Yahoo!?
>>>>>The New Yahoo! Search - Faster. Easier. Bingo.
>>>>>http://search.yahoo.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>---------------------------------------------------------------------
>>
>>
>>>
>>>
>>>
>>>
>>>>>To unsubscribe, e-mail:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>tomcat-user-unsubscribe@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>>For additional commands, e-mail:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>tomcat-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>---------------------------------------------------------------------
>>
>>
>>>
>>>
>>>
>>>
>>>>To unsubscribe, e-mail:
>>>>tomcat-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail:
>>>>tomcat-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>__________________________________
>>>Do you Yahoo!?
>>>The New Yahoo! Search - Faster. Easier. Bingo.
>>>http://search.yahoo.com
>>>
>>>
>>>
>>---------------------------------------------------------------------
>>
>>
>>>To unsubscribe, e-mail:
>>>
>>>
>>tomcat-user-unsubscribe@jakarta.apache.org
>>
>>
>>>For additional commands, e-mail:
>>>
>>>
>>tomcat-user-help@jakarta.apache.org
>>
>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>---------------------------------------------------------------------
>
>
>>To unsubscribe, e-mail:
>>tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail:
>>tomcat-user-help@jakarta.apache.org
>>
>>
>>
>
>
>__________________________________
>Do you Yahoo!?
>The New Yahoo! Search - Faster. Easier. Bingo.
>http://search.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: connection pool - it's standard?
Posted by Tim Funk <fu...@joedog.org>.
FYI: The servlet invoker is evil. Very evil. More info as to why:
http://tomcatfaq.sourceforge.net/miscellaneous.html
-Tim
Bret Hart wrote:
> How do I know my servlet invoker is enabled or
> not?thanks
>
> --- Kwok Peng Tuck <pe...@makmal.net> wrote:
>
>>No, if the servlet invoker is enabled then you don't
>>need to do that.
>>By default I think the servlet is invoker is
>>disabled that's why you have
>>to map your servlets.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: connection pool - it's standard?
Posted by Bret Hart <im...@yahoo.com>.
How do I know my servlet invoker is enabled or
not?thanks
--- Kwok Peng Tuck <pe...@makmal.net> wrote:
> No, if the servlet invoker is enabled then you don't
> need to do that.
> By default I think the servlet is invoker is
> disabled that's why you have
> to map your servlets.
>
> Bret Hart wrote:
>
> >Secondly, I need to map every single JAVA sevlet in
> >the web.xml below?
> >
> >
> >
> ><?xml version="1.0" encoding="ISO-8859-1"?>
> > <!DOCTYPE web-app PUBLIC
> > "-//Sun Microsystems, Inc.//DTD Web Application
> >2.3//EN"
> > "http://java.sun.com/dtd/web-app_2_3.dtd">
> ><web-app>
> > <description>MySQL Test App</description>
> > <resource-ref>
> > <description>DB Connection</description>
> > <res-ref-name>jdbc/TestDB</res-ref-name>
> > <res-type>javax.sql.DataSource</res-type>
> > <res-auth>Container</res-auth>
> > </resource-ref>
> ></web-app>
> >
> >
> >Thanks
> >
> >
> >--- Tarun Ramakrishna Elankath <ta...@webkadai.com>
> >wrote:
> >
> >
> >>The datasource connection pool configuration is
> >>_similar_ for other
> >>vendors. If you have configured a connection pool
> in
> >>Tomcat, then you
> >>would have changed 3 files: the context
> >>configuration (in server.xml or
> >>a separate context.xml) where the JNDI datasource
> is
> >>defined, the
> >>web.xml where the JNDI resource is referenced and
> >>finally in your java
> >>code where the JNDI resource is looked up.
> >>
> >>Your java code and web.xml will certainly not
> >>change. But the details of
> >>context configuration where the JDNI resource is
> >>defined is specific to
> >>each container. That'st the only bit you would
> need
> >>to change.
> >>
> >>Yet another string that might possibly change is
> the
> >>JNDI lookup string
> >>prefix. But you may migrate the same to a
> properties
> >>file.
> >>
> >>PLUS: Tomcat's connection pool configuration isn't
> >>complex. Its just a
> >>bit tedious. But don't worry, you'll soon get the
> >>hang of it. I have
> >>done it 10 times myself now for different
> databases.
> >>Just make sure of
> >>the following:
> >>1)First check using Class.forName and
> >>DriverManager.getConnection that
> >>you able to establish a simply database connection
> >>to your db server.
> >>2)Check that your driver is in a _jar_ (not zip
> >>file) and present in
> >>common/lib. For example the oracle thin driver
> comes
> >>in a classes12.zip
> >>file which must be renamed to a .jar file and put
> in
> >>common/lib.
> >>2)Make sure that your resource definition name and
> >>the resource
> >>reference name within the Context element and
> >>web.xml respectively are
> >>identical.
> >>3) Use a lookup of the form:
> >>java:comp/env/<resource-name> in your java
> >>code.
> >>
> >>That's all!
> >>
> >>For examples take a look at:
> >>
> >>
> >>
>
>http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
> >
> >
> >>Cheers,
> >>Tarun
> >>
> >>
> >>On Sun, 2003-05-04 at 09:29, Bret Hart wrote:
> >>
> >>
> >>>Talking about connection pool, do you think use
> >>>tomcat's pool is better? As im just using the
> >>>connection pool java downloaded from web, and I
> >>>
> >>>
> >>see
> >>
> >>
> >>>the tomcat pool 's installation/setup process is
> >>>
> >>>
> >>quite
> >>
> >>
> >>>complex, or do anyone can give me some ref of
> >>>
> >>>
> >>tomcat
> >>
> >>
> >>>pool setup guides?
> >>>thanks
> >>>
> >>>--- Tim Funk <fu...@joedog.org> wrote:
> >>>
> >>>
> >>>>Yes (I think)
> >>>>
> >>>>-Tim
> >>>>
> >>>>Felipe Schnack wrote:
> >>>>
> >>>>
> >>>>> I was wondering if the way tomcat handles
> >>>>>
> >>>>>
> >>>>connection pools is standanrd. I
> >>>>
> >>>>
> >>>>>mean, If I write my application using tomcat's
> >>>>>
> >>>>>
> >>>>pool, that I access thru JNDI,
> >>>>
> >>>>
> >>>>>etc, I can use my application in another
> >>>>>
> >>>>>
> >>>>container?
> >>>>
> >>>>
> >>>>> /~\ The ASCII Felipe Schnack
> >>>>>
> >>>>>
> >>>>(felipes@ritterdosreis.br)
> >>>>
> >>>>
> >>>>> \ / Ribbon Campaign Analista de Sistemas
> >>>>> X Against HTML Cel.: 51-91287530
> >>>>> / \ Email! Linux Counter #281893
> >>>>>
> >>>>>Centro Universit嫫io Ritter dos Reis
> >>>>>http://www.ritterdosreis.br
> >>>>>ritter@ritterdosreis.br
> >>>>>Fone: 51-32303341
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>>
>
>---------------------------------------------------------------------
> >
> >
> >>>>To unsubscribe, e-mail:
> >>>>tomcat-user-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail:
> >>>>tomcat-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>>
> >>>__________________________________
> >>>Do you Yahoo!?
> >>>The New Yahoo! Search - Faster. Easier. Bingo.
> >>>http://search.yahoo.com
> >>>
> >>>
> >>>
> >>>
>
>---------------------------------------------------------------------
> >
> >
> >>>To unsubscribe, e-mail:
> >>>
> >>>
> >>tomcat-user-unsubscribe@jakarta.apache.org
> >>
> >>
> >>>For additional commands, e-mail:
> >>>
> >>>
> >>tomcat-user-help@jakarta.apache.org
> >>
> >>
> >>>
> >>>
> >>
> >>
> >>
>
>---------------------------------------------------------------------
> >
> >
> >>To unsubscribe, e-mail:
> >>tomcat-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail:
> >>tomcat-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >The New Yahoo! Search - Faster. Easier. Bingo.
> >http://search.yahoo.com
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> >
> >
> >
> >
> >
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: connection pool - it's standard?
Posted by Kwok Peng Tuck <pe...@makmal.net>.
No, if the servlet invoker is enabled then you don't need to do that.
By default I think the servlet is invoker is disabled that's why you have
to map your servlets.
Bret Hart wrote:
>Secondly, I need to map every single JAVA sevlet in
>the web.xml below?
>
>
>
><?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE web-app PUBLIC
> "-//Sun Microsystems, Inc.//DTD Web Application
>2.3//EN"
> "http://java.sun.com/dtd/web-app_2_3.dtd">
><web-app>
> <description>MySQL Test App</description>
> <resource-ref>
> <description>DB Connection</description>
> <res-ref-name>jdbc/TestDB</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
></web-app>
>
>
>Thanks
>
>
>--- Tarun Ramakrishna Elankath <ta...@webkadai.com>
>wrote:
>
>
>>The datasource connection pool configuration is
>>_similar_ for other
>>vendors. If you have configured a connection pool in
>>Tomcat, then you
>>would have changed 3 files: the context
>>configuration (in server.xml or
>>a separate context.xml) where the JNDI datasource is
>>defined, the
>>web.xml where the JNDI resource is referenced and
>>finally in your java
>>code where the JNDI resource is looked up.
>>
>>Your java code and web.xml will certainly not
>>change. But the details of
>>context configuration where the JDNI resource is
>>defined is specific to
>>each container. That'st the only bit you would need
>>to change.
>>
>>Yet another string that might possibly change is the
>>JNDI lookup string
>>prefix. But you may migrate the same to a properties
>>file.
>>
>>PLUS: Tomcat's connection pool configuration isn't
>>complex. Its just a
>>bit tedious. But don't worry, you'll soon get the
>>hang of it. I have
>>done it 10 times myself now for different databases.
>>Just make sure of
>>the following:
>>1)First check using Class.forName and
>>DriverManager.getConnection that
>>you able to establish a simply database connection
>>to your db server.
>>2)Check that your driver is in a _jar_ (not zip
>>file) and present in
>>common/lib. For example the oracle thin driver comes
>>in a classes12.zip
>>file which must be renamed to a .jar file and put in
>>common/lib.
>>2)Make sure that your resource definition name and
>>the resource
>>reference name within the Context element and
>>web.xml respectively are
>>identical.
>>3) Use a lookup of the form:
>>java:comp/env/<resource-name> in your java
>>code.
>>
>>That's all!
>>
>>For examples take a look at:
>>
>>
>>
>http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
>
>
>>Cheers,
>>Tarun
>>
>>
>>On Sun, 2003-05-04 at 09:29, Bret Hart wrote:
>>
>>
>>>Talking about connection pool, do you think use
>>>tomcat's pool is better? As im just using the
>>>connection pool java downloaded from web, and I
>>>
>>>
>>see
>>
>>
>>>the tomcat pool 's installation/setup process is
>>>
>>>
>>quite
>>
>>
>>>complex, or do anyone can give me some ref of
>>>
>>>
>>tomcat
>>
>>
>>>pool setup guides?
>>>thanks
>>>
>>>--- Tim Funk <fu...@joedog.org> wrote:
>>>
>>>
>>>>Yes (I think)
>>>>
>>>>-Tim
>>>>
>>>>Felipe Schnack wrote:
>>>>
>>>>
>>>>> I was wondering if the way tomcat handles
>>>>>
>>>>>
>>>>connection pools is standanrd. I
>>>>
>>>>
>>>>>mean, If I write my application using tomcat's
>>>>>
>>>>>
>>>>pool, that I access thru JNDI,
>>>>
>>>>
>>>>>etc, I can use my application in another
>>>>>
>>>>>
>>>>container?
>>>>
>>>>
>>>>> /~\ The ASCII Felipe Schnack
>>>>>
>>>>>
>>>>(felipes@ritterdosreis.br)
>>>>
>>>>
>>>>> \ / Ribbon Campaign Analista de Sistemas
>>>>> X Against HTML Cel.: 51-91287530
>>>>> / \ Email! Linux Counter #281893
>>>>>
>>>>>Centro Universit嫫io Ritter dos Reis
>>>>>http://www.ritterdosreis.br
>>>>>ritter@ritterdosreis.br
>>>>>Fone: 51-32303341
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>---------------------------------------------------------------------
>
>
>>>>To unsubscribe, e-mail:
>>>>tomcat-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail:
>>>>tomcat-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>__________________________________
>>>Do you Yahoo!?
>>>The New Yahoo! Search - Faster. Easier. Bingo.
>>>http://search.yahoo.com
>>>
>>>
>>>
>>>
>---------------------------------------------------------------------
>
>
>>>To unsubscribe, e-mail:
>>>
>>>
>>tomcat-user-unsubscribe@jakarta.apache.org
>>
>>
>>>For additional commands, e-mail:
>>>
>>>
>>tomcat-user-help@jakarta.apache.org
>>
>>
>>>
>>>
>>
>>
>>
>---------------------------------------------------------------------
>
>
>>To unsubscribe, e-mail:
>>tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail:
>>tomcat-user-help@jakarta.apache.org
>>
>>
>>
>
>
>__________________________________
>Do you Yahoo!?
>The New Yahoo! Search - Faster. Easier. Bingo.
>http://search.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: connection pool - it's standard?
Posted by Bret Hart <im...@yahoo.com>.
Hi, I've task a fast look on
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
First of all, what is the sql below mean? Is it
necessary statement?
mysql> GRANT ALL PRIVILEGES ON *.* TO
javauser@localhost
-> IDENTIFIED BY 'javadude' WITH GRANT OPTION;
Secondly, I need to map every single JAVA sevlet in
the web.xml below?
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<description>MySQL Test App</description>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/TestDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
Thanks
--- Tarun Ramakrishna Elankath <ta...@webkadai.com>
wrote:
> The datasource connection pool configuration is
> _similar_ for other
> vendors. If you have configured a connection pool in
> Tomcat, then you
> would have changed 3 files: the context
> configuration (in server.xml or
> a separate context.xml) where the JNDI datasource is
> defined, the
> web.xml where the JNDI resource is referenced and
> finally in your java
> code where the JNDI resource is looked up.
>
> Your java code and web.xml will certainly not
> change. But the details of
> context configuration where the JDNI resource is
> defined is specific to
> each container. That'st the only bit you would need
> to change.
>
> Yet another string that might possibly change is the
> JNDI lookup string
> prefix. But you may migrate the same to a properties
> file.
>
> PLUS: Tomcat's connection pool configuration isn't
> complex. Its just a
> bit tedious. But don't worry, you'll soon get the
> hang of it. I have
> done it 10 times myself now for different databases.
> Just make sure of
> the following:
> 1)First check using Class.forName and
> DriverManager.getConnection that
> you able to establish a simply database connection
> to your db server.
> 2)Check that your driver is in a _jar_ (not zip
> file) and present in
> common/lib. For example the oracle thin driver comes
> in a classes12.zip
> file which must be renamed to a .jar file and put in
> common/lib.
> 2)Make sure that your resource definition name and
> the resource
> reference name within the Context element and
> web.xml respectively are
> identical.
> 3) Use a lookup of the form:
> java:comp/env/<resource-name> in your java
> code.
>
> That's all!
>
> For examples take a look at:
>
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
>
> Cheers,
> Tarun
>
>
> On Sun, 2003-05-04 at 09:29, Bret Hart wrote:
> > Talking about connection pool, do you think use
> > tomcat's pool is better? As im just using the
> > connection pool java downloaded from web, and I
> see
> > the tomcat pool 's installation/setup process is
> quite
> > complex, or do anyone can give me some ref of
> tomcat
> > pool setup guides?
> > thanks
> >
> > --- Tim Funk <fu...@joedog.org> wrote:
> > > Yes (I think)
> > >
> > > -Tim
> > >
> > > Felipe Schnack wrote:
> > > > I was wondering if the way tomcat handles
> > > connection pools is standanrd. I
> > > > mean, If I write my application using tomcat's
> > > pool, that I access thru JNDI,
> > > > etc, I can use my application in another
> > > container?
> > > >
> > > > /~\ The ASCII Felipe Schnack
> > > (felipes@ritterdosreis.br)
> > > > \ / Ribbon Campaign Analista de Sistemas
> > > > X Against HTML Cel.: 51-91287530
> > > > / \ Email! Linux Counter #281893
> > > >
> > > > Centro Universit嫫io Ritter dos Reis
> > > > http://www.ritterdosreis.br
> > > > ritter@ritterdosreis.br
> > > > Fone: 51-32303341
> > >
> > >
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > > tomcat-user-help@jakarta.apache.org
> > >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Search - Faster. Easier. Bingo.
> > http://search.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> >
> >
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: connection pool - it's standard?
Posted by Tarun Ramakrishna Elankath <ta...@webkadai.com>.
The datasource connection pool configuration is _similar_ for other
vendors. If you have configured a connection pool in Tomcat, then you
would have changed 3 files: the context configuration (in server.xml or
a separate context.xml) where the JNDI datasource is defined, the
web.xml where the JNDI resource is referenced and finally in your java
code where the JNDI resource is looked up.
Your java code and web.xml will certainly not change. But the details of
context configuration where the JDNI resource is defined is specific to
each container. That'st the only bit you would need to change.
Yet another string that might possibly change is the JNDI lookup string
prefix. But you may migrate the same to a properties file.
PLUS: Tomcat's connection pool configuration isn't complex. Its just a
bit tedious. But don't worry, you'll soon get the hang of it. I have
done it 10 times myself now for different databases. Just make sure of
the following:
1)First check using Class.forName and DriverManager.getConnection that
you able to establish a simply database connection to your db server.
2)Check that your driver is in a _jar_ (not zip file) and present in
common/lib. For example the oracle thin driver comes in a classes12.zip
file which must be renamed to a .jar file and put in common/lib.
2)Make sure that your resource definition name and the resource
reference name within the Context element and web.xml respectively are
identical.
3) Use a lookup of the form: java:comp/env/<resource-name> in your java
code.
That's all!
For examples take a look at:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
Cheers,
Tarun
On Sun, 2003-05-04 at 09:29, Bret Hart wrote:
> Talking about connection pool, do you think use
> tomcat's pool is better? As im just using the
> connection pool java downloaded from web, and I see
> the tomcat pool 's installation/setup process is quite
> complex, or do anyone can give me some ref of tomcat
> pool setup guides?
> thanks
>
> --- Tim Funk <fu...@joedog.org> wrote:
> > Yes (I think)
> >
> > -Tim
> >
> > Felipe Schnack wrote:
> > > I was wondering if the way tomcat handles
> > connection pools is standanrd. I
> > > mean, If I write my application using tomcat's
> > pool, that I access thru JNDI,
> > > etc, I can use my application in another
> > container?
> > >
> > > /~\ The ASCII Felipe Schnack
> > (felipes@ritterdosreis.br)
> > > \ / Ribbon Campaign Analista de Sistemas
> > > X Against HTML Cel.: 51-91287530
> > > / \ Email! Linux Counter #281893
> > >
> > > Centro Universit嫫io Ritter dos Reis
> > > http://www.ritterdosreis.br
> > > ritter@ritterdosreis.br
> > > Fone: 51-32303341
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > tomcat-user-help@jakarta.apache.org
> >
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: connection pool - it's standard?
Posted by Bret Hart <im...@yahoo.com>.
Talking about connection pool, do you think use
tomcat's pool is better? As im just using the
connection pool java downloaded from web, and I see
the tomcat pool 's installation/setup process is quite
complex, or do anyone can give me some ref of tomcat
pool setup guides?
thanks
--- Tim Funk <fu...@joedog.org> wrote:
> Yes (I think)
>
> -Tim
>
> Felipe Schnack wrote:
> > I was wondering if the way tomcat handles
> connection pools is standanrd. I
> > mean, If I write my application using tomcat's
> pool, that I access thru JNDI,
> > etc, I can use my application in another
> container?
> >
> > /~\ The ASCII Felipe Schnack
> (felipes@ritterdosreis.br)
> > \ / Ribbon Campaign Analista de Sistemas
> > X Against HTML Cel.: 51-91287530
> > / \ Email! Linux Counter #281893
> >
> > Centro Universit嫫io Ritter dos Reis
> > http://www.ritterdosreis.br
> > ritter@ritterdosreis.br
> > Fone: 51-32303341
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: connection pool - it's standard?
Posted by Tim Funk <fu...@joedog.org>.
Yes (I think)
-Tim
Felipe Schnack wrote:
> I was wondering if the way tomcat handles connection pools is standanrd. I
> mean, If I write my application using tomcat's pool, that I access thru JNDI,
> etc, I can use my application in another container?
>
> /~\ The ASCII Felipe Schnack (felipes@ritterdosreis.br)
> \ / Ribbon Campaign Analista de Sistemas
> X Against HTML Cel.: 51-91287530
> / \ Email! Linux Counter #281893
>
> Centro Universitário Ritter dos Reis
> http://www.ritterdosreis.br
> ritter@ritterdosreis.br
> Fone: 51-32303341
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org