Win a copy of Spring in Action (5th edition) this week in the Spring 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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 Foreman
Posts: 1024
24
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!