| Author |
Database connectivity in struts 2
|
SanjayR Jain
Ranch Hand
Joined: Mar 05, 2009
Posts: 43
|
|
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
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9191
|
|
|
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)...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
SanjayR Jain
Ranch Hand
Joined: Mar 05, 2009
Posts: 43
|
|
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
Joined: Oct 29, 2001
Posts: 8290
|
|
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.
|
"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
|
 |
 |
|
|
subject: Database connectivity in struts 2
|
|
|