Title: connection pooling with normal java bean using struts

Hi,

I want to   create a java bean which takes connection from connection pool provided by struts frame work.
My connection bean contain an attribute called "Connection: connect". In the constructor of this bean, it gets the connection object from the connection pool and sets its property. So if any other class wants to make a query on the database, it first creates an object of this bean and calls the get method "getConnect()", and proceed with the query. How I programmed the connection beans is, it extends the ActionServlet and calls the initDataSource() method  and  findDataSource(null) defined in the  ActionServlet. But I got Null pointer exception. But it works fine if this is defined inside the perform method of the control class. But I want a separate bean for connection pooling. Could you please help me.


Thanks in advance
venkit

Reply via email to