0

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);

2
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by jwenting
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.

0

i am using postgre sql 8.1 database sever.. so what should i use at those plases insted of existing

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.