数据库字段与java属性的对应有关问题

数据库字段与java属性的对应问题
/*
 * 根据分类查询图书
 */
public List<Book> findByCid(String cid){
try {
String sql = "select * from book where cid = ?";
//System.out.println("hh"+cid);
//System.out.println(qr.query(sql, new BeanListHandler<Book>(Book.class), cid));
int a = Integer.parseInt(cid);
return qr.query(sql, new BeanListHandler<Book>(Book.class), a);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
cid在oracle数据库的存储类型时char(32),但是如果我直接写return qr.query(sql, new BeanListHandler<Book>(Book.class), cid);的时候是查不到数据的,只有把cid装换成int类型,才能查询到数据
------解决思路----------------------
没有自动转吧,那你就传值的时候传字符串呗