You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ec...@TXU.COM on 2002/09/25 19:58:41 UTC

Tomcat 4.1.12 and DBCP

Hello:

I just recently downloaded version 4.1.12 to start looking at upgrade route
from version 4.0.4
An issue that I have come across is how the DBCP is working along with
JNDI.

Since the web applications we create here require login verification to an
Oracle database, we used a override the default user name and password that
setup in the server.xml file with what the user entered in. This worked
just fine with version 4.0.4
(See example)

      InitialContext jndiCntx = new InitialContext();
      DataSource ds = (DataSource) jndiCntx.lookup("java:comp/env/jdbc/" +
database.toUpperCase());
      conn = ds.getConnection(user, password);

Now, with version 4.1.12, I always receive and error when trying to
override the default user name and password:

      java.lang.UnsupportedOperationException
             at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:125)

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

             at org.apache.jsp.test_jsp._jspService(test_jsp.java:56)
             at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
             at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

If I use the defaults supplied in the server.xml file, it works without a
problem. (See example)

      InitialContext jndiCntx = new InitialContext();
      DataSource ds = (DataSource) jndiCntx.lookup("java:comp/env/jdbc/" +
database.toUpperCase());
      conn = ds.getConnection();

This is an error with Tomcat? I do not believe so since the error is being
generated from the Apache Commons
DBCP library. So, is this an error or correct execution of the given code?
Would I need to inquire with the
Tomcat group or the Commons group?

I am new to the mailing lists of Apache, so any direction anyone can give
me would be great.

Thanks,
Ej Chambers



**********************************************************************************
Confidentiality Notice: This email message, including any attachments, 
contains or may contain confidential information intended only for the 
addressee. If you are not an intended recipient of this message, be 
advised that any reading, dissemination, forwarding, printing, copying
or other use of this message or its attachments is strictly prohibited. If
you have received this message in error, please notify the sender 
immediately by reply message and delete this email message and any
attachments from your system.  
**********************************************************************************


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>