File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web Application Design

 
Dan Patsey
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 130
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic