开发者

Where to put sql queries in jsp [duplicate]

This question already has answers here: Java Programming - Where should SQL stat开发者_Python百科ements be stored? [closed] (15 answers) Closed 5 years ago.

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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜