Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts datasource

 
Prashanth Chandra
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • 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>
 
Masoud Kalali
Author
Ranch Hand
Posts: 531
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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
  • 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'
 
Rob Morning
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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 ..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic