I just switched over from using plain old connections to JdbcTemplate, and when I ran my application I received this:
org.springframework.jdbc.InvalidResultSetAccessException: Invalid column name; nested exception is java.sql.SQLException: Invalid column name
I found that SqlRowSet does not recognize column name aliases when you use its getXXX methods. Is there a way around this using SqlRowSet? Or do I just have to use the full column names or indices for these columns instead?
Thanks in advance,
ktm
I’m not sure about SqlRowSet, but if you don’t need a disconnected ResultSet (SqlRowSet), another option is to use one of the query methods that takes a RowMapper as a parameter. The RowMapper will get passed a ResultSet, which should support the alias.