• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Struts & DBCP : getting Null Datasource

 
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
i am trying to obtain connection from database connection pool,but i am getting null object of DataSource.
Here is my code :
i have place this line in my Action Class
DataSource dataSource = getDataSource(request);
and these lines in struts-congig.xml
<data-sources>
<data-source key="connectionpool" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName" value="net.sourceforge.jtds.jdbc.Driver" />
<set-property property="url" value="jdbc:jtds:sqlserver://vijays/master"/>
<set-property property="maxActive" value="5" />
<set-property property="username" value="myaccount" />
<set-property property="password" value="mypass" />
<set-property property="autoCommit" value="true" />
<set-property property="maxWait" value="5000" />
</data-source>
</data-sources>
i have placed all the jars in class path.
Please tell me is there any more settings needed (like jndi related..)

Thanks.
Vijay Saraf.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic