When I try that, I get a java.lang.UnsupportedOperationException
        at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:125)

        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:329)

        ...
It's thrown during the getConnection(username, password) function.  I tried
including the username and password parameters in the server.xml file
without a value like this:

<parameter>
        <name>username</name>
        <value></value>
</parameter>

And also completely excluding the username and password parameters.

Mark Lenz
(920) 832-3523
[EMAIL PROTECTED]

                                                                         
  Leo Przybylski                                                         
  <[EMAIL PROTECTED]>               To:        Tomcat Users List     
                                <[EMAIL PROTECTED]>         
                                        cc:                              
  10/17/2002 05:31 PM                   Subject:        Re: Tomcat       
  Please respond to "Tomcat     Connection Pooling                       
  Users List"                                                            
                                                                         





If you are using multiple databases, I believe you have to set up
multiple "Resources" (one for each database). However, you do not have
to specify a username/password. When you retrieve your DataSource from
the "java:comp/env" namespace, you can use getConnection( username,
password). If you don't use multiple users for the database, then this
may seem impractical.

You do need a different "Resource" definition for each database though.

-Leo
http://www.foopan.ath.cx


On Thu, 2002-10-17 at 14:19, Mark Lenz wrote:
> I'm trying to set up DB Connection Pooling with Tomcat 4.1.12 and MySQL
> 4.0.4.  Looking at the sample xml configs I noticed that you have to
> specify the database, username and password.  Is there a way that I can
> change the username and database from within my JSP's?  Or do I just have

> to create different DB contexts in the server.xml file for each database
I
> want to use and which user I want to connect with?
>
> Mark Lenz
> (920) 832-3523
> [EMAIL PROTECTED]
>
> The information contained in this electronic mail message is confidential
information and intended only for the use of the individual or entity named
above, and may be privileged.  If the reader of this messages is not the
intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.  If
you have received this transmission in error, please  contact the sender
immediately, delete this material from your computer and destroy all
related paper media.  Please note that the documents transmitted are not
intended to be binding until a hard copy has been manually signed by all
parties.
> Thank you.


--
To unsubscribe, e-mail:   <
mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <
mailto:tomcat-user-help@;jakarta.apache.org>




The information contained in this electronic mail message is confidential
information and intended only for the use of the individual or entity named
above, and may be privileged. If the reader of this messages is not the
intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If
you have received this transmission in error, please contact the sender
immediately, delete this material from your computer and destroy all
related paper media. Please note that the documents transmitted are not
intended to be binding until a hard copy has been manually signed by all
parties.
Thank you.



--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>

Reply via email to