This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database connectivity in struts 2

 
SanjayR Jain
Ranch Hand
Posts: 43
  • 0
  • 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: 9497
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • 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
  • 0
  • 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: 9214
9
Linux Mac OS X Windows
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic