posted 22 years ago
Before you can "look up" an object, you must first bind the object to a context.
MyDataSource dataSource = new MyDataSource();
Contex c = new InitialContext();
context.bind( "collo/apps", dataSource);
In the above lines, we created a data source, which represents your connection pool, then we created an IntitialContext so we could "bind" the object to an alias -- in this case "collo/apps" -- using JNDI.
The data source is now available to anyone, even applications running on remote machines. It should matter to you "where" the object is stored, because it could be stored on a remote machine.
Hope that helps...
SAF