aspose file tools*
The moose likes Beginning Java and the fly likes Web Application Design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Web Application Design" Watch "Web Application Design" New topic
Author

Web Application Design

Dan Patsey
Greenhorn

Joined: Aug 25, 2006
Posts: 7
Hello, I am creating a web application w/ servlets/JSPs and database access using JDBC. I have about 30 SQL queries that are going to be run against the database in this application. I want to know where I should put these queries so that I can have a servlet execute them. Should I store them all in the servlet? Should I have a separate servlet for each SQL query? Where do I put them?? Thanks =)
John Dell'Oso
Ranch Hand

Joined: Apr 08, 2004
Posts: 130
Dan,

Without further details on your application, is it reasonable to suggest that you store your SQL queries in a file - perhaps a properties file?

Regards,
JD
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42950
    
  70
Keeping them outside of the code is a good idea.

You definitely don't need a separate servlet for each query - the servlet that triggers them should take a parameter to select the proper one.
Dan Patsey
Greenhorn

Joined: Aug 25, 2006
Posts: 7
thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web Application Design