我有一张桌子:
@DatabaseTable
public class Author {
@DatabaseField(columnName = "id", generatedId = true)
public Long id;
@DatabaseField
public String name;
@DatabaseField(unique = true)
public String href;
public Author() {
}
public void add(){
try {
DbHelper.getHelper().getAuthorDao().createOrUpdate(this);
} catch (SQLException e) {
e.printStackTrace();
}
}
}
当我添加一个元素时,它有异常:
Unable to run insert stmt on object Author@86abe70: INSERT INTO `author` (`name` ,`href` ) VALUES (?,?)
我需要获取更新命令的状态,但因为有异常,我不能 什么是最好的练习?