There are some queries used by a DAO layer that is implemented in JDBC Template
String longQuery = ".....";
public List<AnObject> findObjectsBySomething(Something s) {
return getJdbcTemplate().queryForObjects(longQuery, myRowMapper, s);
}
longQuery is going to frequently change, but I don't want to have to manage it right in the source code. How do you go about handling this? I need jdbc template source code, and at least the basics of setting it up in mysql.
Other requirements:
How different is this query? You can store them as files(DAO_NNN.sql where NNN is an id to a specific SQL statement) or store them in an XML file.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.