Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

which one is better to use in project

 
Kaleeswaran Karuppusamy
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.In Struts framework we are using datasource(connection pooling)
we stored and retrieved value from database using DAO class.

2.But in JSTL core having <sql:query>,<sql atasource> ect.

but i am working in struts framework we are using DAO class.

which is better to use either DAO class or jstl tag in jsp,please tell me the reason?

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Avoid the JSTL SQL tags; they should not be used for any serious application. Using them mixes data access code with the presentation layer, which is considered really bad design.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What Ulf said.


From the JSTL Spec.

Many web applications need to access relational databases as the source of dynamic data for their presentation layer. While it is generally preferred to have database operations handled within the business logic of a web application designed with an MVC architecture, there are situations where page authors require this capability within their JSP pages (e.g. prototyping/testing, small scale/simple applications, lack of developer resources). The JSTL SQL actions provide the basic capabilities to easily interact with relational databases.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic