Hi!
Sorry again,
First of all THANK YOU very much Hamish, I had forgotten to register the driver.
Now, the ManualPoolingDriverExample.java works perfect.!
But I don't know, I think (do you agree?) it would be better for me to use the
JOCLPoolingDriver, (because, it would be feasible to have the pool (open) waiting
for requests from my application(is a kind of shopping cart available in the
Intranet formed by some jsp's files which access to the DB)
So, I'm still worried because in that file (JOCLPoolingDriverExample.java) I'm now
getting this message:
Creating connection.
java.sql.SQLException: No pool found for
jdbc:apache:commons:dbcp:/poolingDriverExample.
at
org.apache.commons.dbcp.PoolingDriver.connect(PoolingDriver.java:143)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:199)
at
connpool.JOCLPoolingDriverExample.main(JOCLPoolingDriverExample.java:145)
And it's caused in this piece of code:
System.out.println("Creating connection.");
here-->conn =
DriverManager.getConnection("jdbc:apache:commons:dbcp:/poolingDriverExample");
System.out.println("Creating statement.");
stmt = conn.createStatement();
System.out.println("Executing statement.");
I set all the jar files in the classpath, even the poolingDriverExample.jocl file
that is placed in the tomcat's lib directory �is it ok?. and I registered the
drive like:
-Djdbc.drivers=oracle.jdbc.driver.OracleDriver:org.apache.commons.dbcp.PoolingDriver
What is wrong now?
Thank you!
Nancy
Barney Hamish wrote:
> Hello,
> It looks like you missed the instructions at the top of the source code
> (given below). You need to register the DB driver somehow _before_ you run
> the example program....
> Hamish
>
> //
> // Invoke the class using two arguments:
> // * the connect string for your underlying JDBC driver
> // * the query you'd like to execute
> // You'll also want to ensure your underlying JDBC driver
> // is registered. You can use the "jdbc.drivers"
> // property to do this.
> //
> // For example:
> // java -Djdbc.drivers=oracle.jdbc.driver.OracleDriver \
> // -classpath
> commons-collections.jar:commons-pool.jar:commons-dbcp.jar:oracle-jdbc.jar:.
> \
> // ManualPoolingDriverExample
> // "jdbc:oracle:thin:scott/tiger@myhost:1521:mysid"
> // "SELECT * FROM DUAL"
> //
>
> > -----Original Message-----
> > From: Nancy Crisostomo Martinez [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, September 04, 2002 4:33 PM
> > To: Jakarta Commons Users List
> > Subject: Re: [DBCP]Connection Pool examples troubles
> >
> >
> > Hi everybody,
> >
> > I don't know what is wrong with the code, or maybe there is
> > something wrong with
> > the way I'm trying to run the examples that come with the BDCP API.
> > When I tried to run the ManualPoolingDriverExample.java and the
> > ManualPoolingDataSourceExample.java files I always got the
> > same error message that
> > I got when I try to run the JOCLPoolingDriverExample.java
> > this error message:
> > Creating connection.
> > java.sql.SQLException: No suitable driver
> > at
> > java.sql.DriverManager.getConnection(DriverManager.java:537)
> > at
> > java.sql.DriverManager.getConnection(DriverManager.java:199)
> > at
> > connpool.JOCLPoolingDriverExample.main(JOCLPoolingDriverExampl
> > e.java:145)
> >
> > The line I got the error is this:
> > System.out.println("Creating connection.");
> > here--> conn =
> > DriverManager.getConnection("jdbc:apache:commons:dbcp:/pooling
> > DriverExample");
> > System.out.println("Creating statement.");
> > stmt = conn.createStatement();
> > System.out.println("Executing statement.");
> >
> > I don't know what is happening.
> > I had set the poolingDriverExample.jocl file in the
> > classpath, but I don't know
> > what is happening...
> >
> > Please, help me!
> >
> > Nancy
> >
> >
> >
> > Barney Hamish wrote:
> >
> > > I got it working under 3.X you just have to make sure all
> > the right stuff is
> > > included in your class path i.e. xerxes, commons packages,
> > your .jocl config
> > > file etc.
> > >
> > > Although it's possible to run it under 3.x it's probably
> > better if you do
> > > upgrade. Have a look at the tomcat site, where they
> > recommend versions of
> > > tomcat are ready to be used in production.
> > >
> > > Hamish
> > >
> > > > -----Original Message-----
> > > > From: Nancy Crisostomo Martinez [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, September 03, 2002 4:37 PM
> > > > To: Jakarta Commons Users List
> > > > Subject: Re: [DBCP]Connection Pool examples
> > > >
> > > >
> > > > One more question about this:
> > > > Is it possible to implement a pool connection using Jakarta
> > > > commons in Tomcat 3.3
> > > > or do I have to upgrade to 4.x?
> > > > This is because I found a couple of examples but they are
> > > > implemented in Tomcat
> > > > 4.x.
> > > >
> > > > If I have to upgrade, which version do you recomend me?
> > > >
> > > > Thanks,
> > > > Nancy.
> > > >
> > > >
> > > > Barney Hamish wrote:
> > > >
> > > > > See below...
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Nancy Crisostomo Martinez
> > [mailto:[EMAIL PROTECTED]]
> > > > > > Sent: Monday, September 02, 2002 5:39 PM
> > > > > > To: Jakarta Commons Users List
> > > > > > Subject: Re: [DBCP]Connection Pool examples
> > > > > >
> > > > > >
> > > > > > Thanks Barney,
> > > > > >
> > > > > > I haven't found in the documentation how to setup the pool.
> > > > >
> > > > > I must admit a struggled with the DBCP docos at first too.
> > > > They are on the
> > > > > terse side. Have a look at the examples in that come with
> > > > DBCP. There is one
> > > > > on how to use it in driver mode and one for DataSource
> > > > mode. You can run the
> > > > > both from the console. That should give you a pretty good
> > > > idea of what you
> > > > > need to do in your application.
> > > > >
> > > > > > The only documentation
> > > > > > I had read is the one generated with JavaDoc that comes with
> > > > > > JBDC but it is
> > > > > > pretty short.
> > > > > > -I couldn't find the advantages or disadvantages and
> > > > > > differences in using the
> > > > > > PoolingDriver or using the PoolinDataSource.I would like to
> > > > > > read a detailed
> > > > > > explanation about this, and I couldn't find it in the that
> > > > > > documentation.
> > > > >
> > > > > Datasources are the newer and I believe prefered way of
> > > > obtaining access to
> > > > > databases. I'm sure there are articles on the java.sun.com
> > > > website comparing
> > > > > them.
> > > > >
> > > > > > -In addition, I would like to know where are the basic
> > > > > > classes to implement the
> > > > > > pool.
> > > > >
> > > > > DBCP uses the generic object pools implemented in the
> > > > jakarta commons Pool
> > > > > project to implement connection pooling.
> > > > > http://jakarta.apache.org/commons/pool.html
> > > > >
> > > > > Goodluck,
> > > > > Hamish
> > > > >
> > > > > >
> > > > > > Thanks again, and I hope you don't get desesperated about my
> > > > > > ignorance, but I'm
> > > > > > new.
> > > > > >
> > > > > > Nancy.
> > > > > >
> > > > > >
> > > > > > Barney Hamish wrote:
> > > > > >
> > > > > > > DBCP implements the connection pooling API, all you have to
> > > > > > do is configure
> > > > > > > it. Have you looked at the DBCP documentation? It details
> > > > > > how to setup a
> > > > > > > connection pool. What is your specific problem?
> > > > > > >
> > > > > > > Hamish
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Nancy Crisostomo Martinez
> > > > [mailto:[EMAIL PROTECTED]]
> > > > > > > > Sent: Monday, September 02, 2002 5:03 PM
> > > > > > > > To: Jakarta Commons Users List
> > > > > > > > Subject: [DBCP]Connection Pool examples
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi everyone!
> > > > > > > > I've sent this question before but unfortunatly, I haven't
> > > > > > > > recieved any
> > > > > > > > answer.
> > > > > > > >
> > > > > > > > I would like to know if there are some practical examples
> > > > > > > > on-line about
> > > > > > > > how to implement the Data Base Connection Pool API.
> > > > > > (Tomcat, Oracle)
> > > > > > > > Could you please give me some references?
> > > > > > > >
> > > > > > > > Thanks in advance
> > > > > > > > Nancy.
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > > > <mailto:[EMAIL PROTECTED]>
> > > > > > > > For additional commands, e-mail:
> > > > > > > > <mailto:[EMAIL PROTECTED]>
> > > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > > <mailto:[EMAIL PROTECTED]>
> > > > > > > For additional commands, e-mail:
> > > > > > <mailto:[EMAIL PROTECTED]>
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > > > <mailto:[EMAIL PROTECTED]>
> > > > > > For additional commands, e-mail:
> > > > > > <mailto:[EMAIL PROTECTED]>
> > > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <mailto:[EMAIL PROTECTED]>
> > > > > For additional commands, e-mail:
> > > > <mailto:[EMAIL PROTECTED]>
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > > <mailto:[EMAIL PROTECTED]>
> > > > For additional commands, e-mail:
> > > > <mailto:[EMAIL PROTECTED]>
> > > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>