944,183 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 2918
  • Java RSS
Dec 22nd, 2006
0

Connection pooling in java

Expand Post »
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);
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
rpjanaka is offline Offline
69 posts
since Sep 2006
Dec 22nd, 2006
0

Re: Connection pooling in java

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Dec 22nd, 2006
0

Re: Connection pooling in java

i am using postgre sql 8.1 database sever.. so what should i use at those plases insted of existing
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
rpjanaka is offline Offline
69 posts
since Sep 2006
Dec 22nd, 2006
0

Re: Connection pooling in java

I wouldn't know, but the documentation for the JDBC driver you need will know.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Converting MS-DOS into Java
Next Thread in Java Forum Timeline: How to add a vector content in to the hashtable as a value





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC