File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes How to set connection pool size,max wait time for connection through java code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "How to set connection pool size,max wait time for connection through java code" Watch "How to set connection pool size,max wait time for connection through java code" New topic
Author

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

Pushkar Mahamuni
Greenhorn

Joined: Mar 04, 2014
Posts: 14
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?
Claude Moore
Ranch Hand

Joined: Jun 24, 2005
Posts: 500
    
    1

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set connection pool size,max wait time for connection through java code