• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

connection pooling in websphere 5.1

 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ,
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and another question is ...can we use apache commons-dbcp factory in websphere for connection pooling as third party....
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks williams...
it was only a versioning problem...
reply
    Bookmark Topic Watch Topic
  • New Topic