java - JdbcTemplate problems with nested queries -


I am trying to experiment with Nedsted queries with the JDBC template, but I found out the problem, It seems that this is not in the question. Am I right? Or do I need to change?

Then, I invoke

  getJdbcTemplate (). Query (request, new object [] {name} ...) / request query that you can see in the error message   

, which returns the result in Oracle but

fails with org.springframework.jdbc.InvalidResultSetAccessException: created callbacks; Select the invalid result of SQL [name as name by name (select the name as out of table 1 t1 t2.id = t1.fk_id, select 2 t2 in the left outer table, where t1.name Is not empty) (name) as upper ('?')] ; Nested exception Java.sql.SQLException: invalid column index

edit

The request is a simple string object that is actually a SQL that you see in the exception message.

  list & lt; MyObject & gt;  

; List = getJdbcTemplate (). Query (request, new object [] {"Somename"}, new RowMapper () {Public Object mapRow (ResultSet rs, int rowNum) throws SQLException {new MyObject {};}});

Try changing upper ('?') upper (?) . ? By quoting in the quote, the database does not know that you are working with a parameter.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -