http://www.mchange.com/projects/c3p0/index.html
c3p0 was designed to be butt-simple to use. Just put the jar file
[lib/c3p0-0.9.0.jar] in your application's effective CLASSPATH, and make a
DataSource like this:
import com.mchange.v2.c3p0.*;
...
ComboPooledDataSource cpds = new ComboPooledDataSource();
cpds.setDriverClass( "org.postgresql.Driver" ); //loads the jdbc driver
cpds.setJdbcUrl( "jdbc:postgresql://localhost/testdb" );
cpds.setUser("dbuser");
cpds.setPassword("dbpassword");
[Optional] If you want to turn on PreparedStatement pooling, you must also set
maxStatements and/or maxStatementsPerConnection(both default to 0):
cpds.setMaxStatements( 180 );
Do whatever you want with your DataSource, which will be backed by a
Connection pool set up with default parameters. You can bind the DataSource
to a JNDI name service, or use it directly, as you prefer.
When you are done, you can clean up the DataSource you've created like this:
DataSources.destroy( cpds );
That's it! The rest is detail.
hth
ido
---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majo...@postgresql.org so that your
message can get through to the mailing list cleanly
It's telling you what the problem is right there: you haven't supplied
sufficient information to construct an initial context. Specifically,
it wants you to tell it what class to use for java.naming.factory.initial.
What is your runtime platform? How you bind resources into JNDI is
determined by your runtime platform. Furthermore, many if not most
platforms provide a means to pool connections. Both JBoss and Tomcat
do, so constructing a pooled connection in those environments is as
simple as defining them in a configuration file, then looking them up in
your code.
--
Guy Rouillier
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings