Is a good idea store SQL statements in static xml files?

Discussions

General J2EE: Is a good idea store SQL statements in static xml files?

  1. I'm working in a J2EE project which all SQL queries are stored in a xml file, then our EJBs can recall those queries at need. Is that a good aproach?

      Regards,
      lottalava
  2. yes it is a good approach you can change sql any time without recompiling the code but remember to cache the queries otherwise it will create an overhead of reading an XML and at the same time there will be a provision of refreshing the cache so that it will sense the change in query