Sql sql2 = Sqls.create("SELECT IFNULL(MAX(torder),0)+1 FROM banner");
dao.execute(sql2);
sql2.setCallback(Sqls.callback.integer());
int torder = sql2.getInt();
Sql sql2 = Sqls.create("SELECT IFNULL(MAX(torder),0)+1 as count FROM banner");
dao.execute(sql2);
sql2.setCallback(new SqlCallback() {
public Object invoke(Connection conn, ResultSet rs, Sql sql) throws SQLException {
while (rs.next()){
return rs.getString("count");
}
return null;
}
});
int torder = sql2.getInt();
都是空指针?