• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
Being a smart alec beats the alternative. This tiny ad knows what I'm talking about:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic