• 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
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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 ..
 
Beauty is in the eye of the tiny ad.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic