Registering a JDBC ConnectionPoolDataSource for Client Access

I am trying to create a JDBC Connection pool using poolman found at http://www.codestudio.com/ . I choose this because it was suggested on this forum. I have read the the JDBC Tutorial many times in regards to DataSource Objects and ConnectionPoolDataSource Objects. I think I am missing something. All documentation from poolman and JDBC seems to show how to access remotely pooled JDBC Connections, datasource.getConnection(), but not how to set up the server environment so they are accessible.

What I can't seem to figure out is how I create an RMI server, or any type of service provider, which allows a client to run code like this, from JDBC tutorial:

// client code

ctx = new InitialContext();

ds = (DataSource)ctx.lookup("jdbc/fastCoffeeDB");

try {

Connection con = ds.getConnection("myLogin", "myPassword");

// ... code to use the pooled connection con

}

catch (Exception ex {

// . . . code to handle exceptions

}

finally {

if(con != null) con.close();

}

I just can't seem to figure out how to set up the server code and associated properties files, if needed? Sun has a tendency to be scatter-brained when it comes to documentation, clear cut examples in some cases can be hard to find.

Any wisdom or thoughts on this would be greatly appreciated.

[1382 byte] By [geek_freak] at [2007-9-26 10:13:48]
# 1

I forgot to add that poolman user guide states this,

"Standard Java Naming and Directory Interface (JNDI) server practice is to bootstrap the naming provider through a jndi.properties file that specifies basic settings such as which ContextFactory to use. Your JNDI provider will include such a properties file; you need only add its directory to your CLASSPATH.

When a connection pool is created, that pool will attempt to bind itself to the naming provider defined through the jndi.properties file. When a pool is stopped, it unbinds itself."

I am a little lost on how to accomplish this but I think it is what I am looking for. The test code I am running tells me that, output from poolman, that my 2 connections have been made and pooled successfully but it then gives me this error,

"PoolMan JDBCPool unable to locate a default JNDI provider, DataSource is still available -- for example, get the DataSource via PoolMan.findDataSource(NOCPool) --but is not available through JNDI: localhost:389"

I do have rmiregistry running, and tested with an RMIServer running, same error in all cases.

geek_freak at 2007-7-1 22:15:01 > top of Java-index,Core,Core APIs...