One of my tables has a column type like inet. And when I try to perform an insert operation using String as the type for the inet column, it says that "column" ip "is of type inet, but the expression has a type character that changes:", which is a perfectly valid exception. Now, my question is how can I give jdbcTemplate instructions to use the inet type instead of String. I'm trying something like:
MapSqlParameterSource params = new MapSqlParameterSource(); params.addValue("ip",new SqlParameterValue(Types.??, conn.getIPAddress()));
The inet type is not specified in the Types class, what should I pass?
PS I am using PostgresSql version 8.4.4.
postgresql jdbctemplate
Amit goyal
source share