• 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

Datasource configuration in struts.xml

 
Ranch Hand
Posts: 49
Hibernate Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In struts2 for database configuration in struts.xml not working ,Kindly suggest the comments
I have tried following database configuration steps
<data-sources>
<data-source key="pizza">
<set-property property="driverClass"
value="sun.jdbc.odbc.JdbcOdbcDriver" />
<set-property property="url"
value="Jdbc:Odbc:issuetracking" />
<set-property property="username" value="sa" />
<set-property property="password" value="sa" />
</data-source>
</data-sources>

public String execute() throws Exception
{
HttpServletRequest request;
DataSource ds = getDataSource(request, "pizza");
Connection con = ds.getConnection();
setMessage(getText(MESSAGE));
return SUCCESS;
}
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We do not configure DataSource in struts.xml and we can do data source configuration using spring, hibernate Tomcat DataSource Configuration
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Mohana infers, datasource was removed from Struts after version 1.2.7.
Struts 2 is a very different framework from Struts 1.x (it is actually based on another framework, XWork). The fact that you are attempting to use datasource in Struts 2 makes me think you haven't worked much with Struts 2. Here is a summary of the differences.
 
reply
    Bookmark Topic Watch Topic
  • New Topic