• 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

How to set connection pool size,max wait time for connection through java code

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
There is one devloped java code in which the code is interacting with As400 Db and drivers used are JT400(version 8.2). The method used to connect to Db is getjdbctype4connection() ,statement and result set are used to interact DB queries. So is there any possible way to set connection pool size,max wait time for connection through code? if yes then what changes do I need to do in current code?
 
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you talking about a connection pool defined in Websphere application server, or do you want to create a Connection Pool outside Websphere - for example inside a stand-alone java program ?
In the first case, I'm not aware of a method to set properties you pointed out, but, even if they exist, I won't use them if I were you - Datasource config should be handled within an appserver context, not programmatically (IMHO).
Besides this, why you use getjdbctype4connection() ? You should work with DataSources, look up them and use getConnection() method to retrieve connections to database. You should not rely on which JDBC driver is actually
used in your application.
In the second case, yes, I remember that you can setup a connection pool with JT400 - i don't remember details, though. But you should find a lot of examples on IBM's toolbox web site.

Hope this helps.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic