tags:

views:

21

answers:

0

Sooo.. We found a bug and the stack pretty much looked like this

com.sybase.jdbc2.jdbc.SybSQLException: Class [java.lang.Integer not found. Check and make sure that the class has been installed, and an entry exists in Sysxtypes.

Then I thought, aaaaw, I just have to convert 'em into primitives.

int[] ids = ArrayUtils.toPrimitive(set.toArray(new Integer[set.size()]));

And then plugged the ids into the query

return namedParameterJdbcTemplate.query("select distinct id from Coffee where id in ( :ids )", Collections.singletonMap("ids", ids),
            new ParameterizedRowMapper<Integer>(){
            public Integer mapRow(ResultSet rs, int rowNum) throws SQLException {
                return rs.getInt("id");
            }
        });

Ok. Then I got this;

com.sybase.jdbc2.jdbc.SybSQLException: Class [I not found. Check and make sure that the class has been installed, and an entry exists in Sysxtypes.

I've never had any problems using either Integer nor int when I'm using the spring jdbc templates together with sybase. Any ideas?