Connection pooling in java
hi i am tring to use connection pooling in java with postgresql database.
in given examples, i cant understand these file names that is given to create
InitialContext object, also that file names are different for each and every examples.
how can i get those files, and what are those..?
// Set up environment for creating initial context
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.fscontext.RefFSContextFactory");
env.put(Context.PROVIDER_URL, "file:c:\\JDBCDataSource");
Context ctx = new InitialContext(env);
// Register the data source to JNDI naming service
ctx.bind("jdbc/ConnectSparkyOracle", ds);
rpjanaka
Junior Poster in Training
69 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
That's the JDBC driver for the database you're planning to talk to.
Read its documentation, it will tell you what to do.
The first is a classname (provided by the driver), the second looks to be the URI for the driver to talk to the actual database (in this case a simple directory on the local filesystem, not something you'd want for a production system).
Do read some basic JDBC tutorials and your driver documentation. It makes life so much easier.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
i am using postgre sql 8.1 database sever.. so what should i use at those plases insted of existing
rpjanaka
Junior Poster in Training
69 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
I wouldn't know, but the documentation for the JDBC driver you need will know.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337