Getting "Invalid column type" excecption, while using NamedParameterJDBCTemplate for insertion
You are getting this exception because you are using JdbcTemplate
instead of NamedParameterJdbcTemplate
. MapSqlParameterSource
works with NamedParameterJdbcTemplate
.
You might want to try using strings instead of characters for your CHAR(1) Y/N fields.
Try changing your code to:
paramSource.addValue("NAME1",sponsor.getName(), Types.VARCHAR);
paramSource.addValue("INDUSTRY_TYPE", sponsor.getIndustryType(), Types.INTEGER);
paramSource.addValue("IS_NOT_SOLICITE", sponsor.getNotSoliciteFlag()?'Y':'N', Types.CHAR);
paramSource.addValue("IS_REPORTING_SPONSOR", sponsor.getReportingFlag()?'Y':'N', Types.CHAR);