2

I am working in a jsp project. I have several SQLs. Currently I hard code them in the relating .java files. I guess this maynot be the proper way to do. Where should I put them? In a config.xml or sql.xml? Put them into a properties file? or put them in files with .sql extension separately, but them what is the proper and easy way to access them? Or any other good suggestions? Thanks in advance.

3
  • Related: stackoverflow.com/questions/1661921/… This question by the way also indicates that you didn't read the links I posted in an answer in your previous question. I suggest to do so. Commented Jun 29, 2010 at 11:38
  • Thanks for the link to the discussion. The link (balusc.blogspot.com/2008/07/dao-tutorial-data-layer.html) you suggested previously is broken with this error message "The webpage at balusc.blogspot.com/2008/07/dao-tutorial-data-layer.html might be temporarily down or it may have moved permanently to a new web address." Couldn't access!! I really appreciate for your continuous help. Thanks. Commented Jun 29, 2010 at 14:35
  • Hmhm... I still can't access it.. Maybe because blogspot.com contain 'sensitive' material so it is blocked like Facebook and Twistter by Chinese government... (that's why Google left China).. Commented Jun 30, 2010 at 12:39

1 Answer 1

2

Definitely not in the jsp, check out the DAO pattern.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.