Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connection pooling in websphere 5.1

 
Milan Jagatiya
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
how to achieve connection pooling in websphere 5.1?
right days i am using tomcat web server and its connection pooling (dbcp). now i want to deploy my application in websphere 5.1.
what changes should i need in my application for that?...

thanks ,
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34422
347
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Milan,
You just use a database driver that supports connection pooling when you set up your datasource.
 
Milan Jagatiya
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah...I am using MS SQL Server 2000. what i need to set connection pooling. i am using type 4 driver. "sqljdbc.jar". is any other jar do i need??
 
Milan Jagatiya
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and another question is ...can we use apache commons-dbcp factory in websphere for connection pooling as third party....
 
William Janssen
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Creating JDBC connections using Microsoft SQL is explained in http://publib.boulder.ibm.com/infocenter/ad51help/index.jsp?topic=/com.ibm.etools.rsc.doc/tasks/tdbconn_sqlserver.htm

From that point, it is like in any other environment, eg:

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "corbaloc:iiop:myhost.mycompany.com:2809");
Context initialContext = new InitialContext(env);
DataSource specificDataSource = (DataSource) initialContext.lookup("java:comp/env/jdbc/myds");
 
Milan Jagatiya
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using ms sql server 2000. what steps should i follow to achieve connection pooling in websphere 5.1 ???

waiting for your replies...

thanks...
 
William Janssen
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- Define the JDBC provider (in the admin console, resources -> JDBC providers)
- Within this provider define a datasource pointing to youre database

Call this datasource from your code with the example provided before, that's it.
 
Milan Jagatiya
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks williams...
it was only a versioning problem...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic