Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database connectivity in struts 2

 
SanjayR Jain
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to connect my application to Database.
This is what I have done yet:


Is there any other way to connect the database in struts 2 Application?
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of solution are you looking for?? You can use Hibernate with your Struts application. You can also create a database connection pool (without hibernate)...
 
SanjayR Jain
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No I am not using hibernate.
It is just a simple application of jsp servlets.
Is there any way using web.xml or struts.xml
I am using Struts 2.
 
Joe Ess
Bartender
Posts: 9280
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Struts is an implementation of the front controller pattern. It has nothing to do with back-end tasks like database connectivity.
That said, it is common to encapsulate common tasks like obtaining a database connection and put it into an interceptor.
You may also want to look at your container's documentation and see if it can manage database connections. I know Tomcat and Weblogic do.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic