• 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 datasource

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been trying to connect to Struts datasource. Please help me in this as i have been getting this error.

SEVERE: Initializing application data source org.apache.struts.action.DATA_SOURCE
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'jdbc ostgresql://localhost/databasename.

This is my struts-config.xml datasource configuation
<data-sources>

<data-source type="org.apache.tomcat.dbcp.dbcp.BasicDataSource">
<set-property property="autoCommit" value="false"/>
<set-property property="description" value="TTM Data Source Configuration"/>
<set-property property="driverClass" value="org.postgresql.Driver"/>
<set-property property="maxCount" value="4"/>
<set-property property="minCount" value="2"/>
<set-property property="password" value="infinity"/>
<set-property property="url" value="jdbc ostgresql://localhost/databasename"/>
<set-property property="user" value="infinity"/>
</data-source>
 
Author
Posts: 531
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it seems that you have no suitable driver for your connection string. so check to see whether you have postgresql.js (postgresql jdbc driver) in your web-inf/lib folder or not.
 
Prashanth Chandra
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Thanks for the reply. I have included pg74.215.jdbc3.jar and jdbc.jar files in the class path. I have also included these jar files in my application in the WEB-INF/lib. But still the same error occurs.

The error is
SEVERE: Initializing application data source org.apache.struts.action.DATA_SOURCE
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'jdbc ostgresql://localhost/databasename'
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are using Commons dbcp then the correct <set-property> sub elements
are :

<set-property property="driverClassName" value="org.postgresql.Driver"/> NOT
"driverClass"
<set-property property="username" value="infinity"/> NOT "user"

Try that and I think you should be okay .. If your using other DataSources then you need to check the appropriate documentation to determine the available property data ..
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic