JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
String name="Ram"; int id=2;
String sql="select * from"+dbName+ ".Employee where name=? and id=?";
List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql, name, id);
This is existing working code. I need to move the sql string to .sql file. Need to read the full query from .sql
I tried this code-
String path = new File(ClassLoader.getSystemClassLoader().getResource("SQL/employee.sql").getFile()).toPath().toString();
But query is not executing getting below exception-
threw exception
[Request processing failed: org.springframework.jdbc.UncategorizedSQLException