Re: Where to store SQL statement
- From: "tzvika.barenholz@xxxxxxxxx" <tzvika.barenholz@xxxxxxxxx>
- Date: 10 May 2007 00:58:12 -0700
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
.
- Follow-Ups:
- Re: Where to store SQL statement
- From: Bruce Lewis
- Re: Where to store SQL statement
- References:
- Where to store SQL statement
- From: jsguru72
- Where to store SQL statement
- Prev by Date: Re: Where to store SQL statement
- Next by Date: Re: Where to store SQL statement
- Previous by thread: Re: Where to store SQL statement
- Next by thread: Re: Where to store SQL statement
- Index(es):
Relevant Pages
|
|