• Post Reply Bookmark Topic Watch Topic
  • New Topic

Storing Sql queries in Database or Context

 
Pratibha Malhotra
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have heard of an Architecture wherein Sql Queries are stored in Database itself or in Context of application. As and when required these queries are fetched and are executed.
Is there any architecture that mandates or supports this type of logic.
What is the main advantage behind such kind of mechanism..
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never heard of a java architecture which stores database queries in ServletContext, so i will not comment on that. Although the idea looks very strange to me.
Although there are many different patterns, which you can use according to your requirement, Following link will provide you more information about that
http://java.sun.com/developer/technicalArticles/J2EE/patterns/J2EEPatternsRoadmap.html
[ March 03, 2004: Message edited by: Prakash Dwivedi ]
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do u mean that you put the SQL statement in the <init-param> of the Servlet Context inside the web.xml?
If so, the SQL can be stored inside the Context, however, the param is "read-only", you cannot update it, so, if you need to change the SQL, you need to restart the container.
Nick.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!