我将值插入表人,假设我输入1,Ram,22,98; 1,的Kri,22,83; 1,萨姆,23,47;
当它返回时,光标从1开始,Sam,23,47; 1,的Kri,22,83;
1,羊,22,98;我无法弄清楚错误。欢迎任何形式的帮助!
Create table People(id integer ,Name text,Age int,pplid primary key not null);
INSERT INTO People(id,Name,Age, pplid) VALUES (?,?,?,?);
_statement = _dbTopNews.createStatement("Select * from People where id = 10;");
_statement.prepare();
Cursor _cursor = _statement.getCursor();
Row _row;
_vecTopNews = new Vector();
while(_cursor.next()){
_custObj = new CustomObj();
_row = _cursor.getRow();
_id = _row.getString(0);
_name = _row.getString(1);
_age = _row.getString(2);
_pplid = _row.getString(3);
_custObj.setID(_id );
_custObj.setName(_name );
_custObj.setAge(_age );
_custObj.setPplId(_pplid );
_vec = new Vector();
}
答案 0 :(得分:1)
你应该使用id作为索引列,例如1的唯一值,Ram,22,98; 2,的Kri,22,83; 3,山姆,23,47 然后sql语句将是"从人员中选择*,其中id = 10 ORDER by id;"