Where to store SQL statement



I write a lot of JSP pages with backend classes to access MySQL
databases. One of my biggest problems is having the SQL statements
hardcoded in class.

Everytime I have to make a slight change to the sql statement, I have
to completely recompile the entire class. This is especially
troublesome during testing when I have to update the statements
numerous times until I get it just right.

Where should I be storing the statements?

Should I put them in a text file and read them in when needed? I have
thought of this, but I am concerned about the overhead of opening and
reading a file just to get a SQL statement.

Just trying to find out some ideas.

Thanks.

.



Relevant Pages

  • Re: SQL Statement
    ... I used the IN Clause to accomplish this. ... a sample for those of you wanting to know how. ... > connection string into the SQL Statement? ... Both databases are in Access ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: pySQLite Insert speed
    ... is not only faster on many databases, ... Thx. ... must have had something wrong in my original timing. ... Don't forget, by the way, that your original code was performing the string substitution of the parameter markers into the SQL statement each time the statement was executed. ...
    (comp.lang.python)
  • Re: Where to store SQL statement
    ... databases. ... Everytime I have to make a slight change to the sql statement, ... but I am concerned about the overhead of opening and ... reading a file just to get a SQL statement. ...
    (comp.lang.java.databases)
  • SOAP and Content Databases
    ... I built a little app that can create a SQL statement based on the list. ... where the Content Databases are... ...
    (microsoft.public.sharepoint.portalserver.development)