2013年9月20日星期五

java exception

In java query data in the database is reported abnormal Exception: Column Index out of range, 2> 1. Column Index out of range, 2> 1. What does this mean ? My code in java : HouseResourceRentDao hrrd = HouseResourceRentDaoFactory.create ();
String sql = "select * from house_resource_rent where city_id = 4";
HouseResourceRent rentHss [] = HouseResourceRentDaoFactory.create (). findByDynamicSelect (sql, null);
------ Solution ----------- ---------------------------------
take resultSet column values ​​when the column number of the right

For example, you check out only two , but you resultset.getString (3) take the third column values ​​, will complain of
------ Solution ------- -------------------------------------
+1
----- - For reference only ---------------------------------------
you can look there is no such database id number, sometimes the details determine success or failure ah
------ For reference only ----------------------- ----------------
index wrong.

没有评论:

发表评论