New to Java - Design question about storing a series of text (SQL) resources for a web application
I'm new to Java, but experienced with other languages. I am trying to create a web application that executes a series of SQL statements against a database and collects, summarises and displays the results.
The basics of the code are not too difficult, but I'm not sure what is the best way (the most natural for Java, I guess) of storing the queries and a small amount of metadata. I'd have a series of maybe 10-15 queries, and for each query I'd want to keep a name.
If I were coding in another language, I'd probably store all of the queries in a series of files alongside the app, with the filename being the query name, and the content of the file being the SQL to run. I'd then scan the directory at runtime for *.sql files, and read each one in turn.
As my Java code will ultimately be turned into a WAR file for deployment, I'm not quite sure what would be the equivalent approach for Java. Or if this is a completely inappropriate way of working in Java, what I should be doing instead.
If anyone can give me some suggestions, or point me at some examples or tutorials on the web that would help, I'd be most grateful.