Re: Where to store SQL statement



On May 10, 3:59 am, jsguru72 <j...@xxxxxxxxxx> wrote:
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.

I would export the SQL to a txt, or better XML file. The extra
overhead of reading the disk is probably not a lot, considering that
whenever you read the sql presumably you are running a query to the
database, which probably takes >> more time than the simple file
access.

T

.



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)
  • 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)
  • 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 ... Everytime I have to make a slight change to the sql statement, ...
    (comp.lang.java.databases)
  • RE: performance issues(OracleDataReader & Adapter)
    ... by mistake my oracle hint was missing in the query ... > seconds in reading 50 records). ... > the same sql statement in SQL plus is taking less than 2 seconds. ...
    (microsoft.public.dotnet.framework.adonet)