Hi, Jehan! There is a way to do so by opening a connection and then using it and returning it to the pool without closing it. Then you could have many connections sitting in a pool waiting to be used - and less overhead. I would suggest just writing a JavaBean class to accomplish that.
Anton Golovin (firstname.lastname@example.org) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
"I know this is what Data Sources a for, but suppose we could not create a data source through the app server" Why can't use create a data source through the app server? Is this a standalone application?
Jehan, I don't know of any driver for delimitted files. Unless htxx provides one ...
A connection pool is something you need to write. The idea is that you instantiate a fixed number of connections. Then you provide methods to claim them and return them to the pool. I suggest searching for "connection pool" on the web. You may find something prewritten as this is a common problem.
Which version of WAS are you on? WAS 3.5,4.03.5.01? I have never heard of DataSource coming from a tab-delimited file? If you are WAS 4.0+, you have to create the DataSource through the Admin Console.
I think you need to clarify if you want to use straight JDBC connection or use the connection pooling. Straight JDBC connection does not require datasource. ONLY connection pooling requires DataSource object. Again that reside on the server because how is the server going to manage the pool of connections if it does not reside on the server.
posted 15 years ago
Jeanne, That sounds like a good idea. I only wonder if EJBs support having a single static class that can be accessed by all beans?
posted 15 years ago
Joseph, I am currently on WAS 5.1 and to the best of my knowledge there is no DataSource for text files now. The only way I can access it now is through straight JDBC connection, I would like to create a data source for it in WAS so I can have a connection pool and not have to create a connection each time I use it.
Originally posted by Jehan Jaleel: Jeanne, That sounds like a good idea. I only wonder if EJBs support having a single static class that can be accessed by all beans?
Jehan, EJBs are just classes so they can access a static class just as any other can. If you put the static class in the EJB project you should be good. Note that if you use a clustered server, you will really have one static class per clone. But this is ok as it still provides some caching/pooling capability.
Anandh, Thanks for the reference. Note that we have an edit button (paper and pencil icon) if you want to change a previous post.