This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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?
 
Ranch Hand
Posts: 982
9
IBM DB2 Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!