• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Struts Connection pool (please help)

Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am trying the example from the book "Struts For Dummies" ,

I got this error :


here is the DataSource Definition in struts-config.xml :

<data-source key="musiccollection"
<set-property property="description" value="Music Collection Database"/>
<set-property property="driverClassName" value="com.mysql.jdbc.Driver"/>
<set-property property="username" value="root"/>
<set-property property="password" value="malta122"/>
<set-property property="url"

LoginBean.java :

Please tell me what this line :
con = dataSource.getConnection(); // line 36

is missing ?

Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct me if I am wrong, but I believe it is stating that the reference to your dataSource object is NULL.

It appears that the dataSource object you pass to the LoginBean's constructor is NULL.
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I would say the DataSource is null I think you have your url specified incorrectly. If you haven't tried this already try putting the port number after the the localhost (most likely localhost:3306 unless you have mysql running on a different port).

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