我的应用程序中有一个预先填充的数据库。运行项目时出现此错误:
06-17 17:15:22.554: ERROR/AndroidRuntime(482): java.lang.AbstractMethodError: abstract method not implemented
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at com.j256.ormlite.android.AndroidDatabaseConnection.compileStatement(AndroidDatabaseConnection.java)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at com.j256.ormlite.stmt.mapped.MappedPreparedStmt.compile(MappedPreparedStmt.java:39)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at com.j256.ormlite.stmt.StatementExecutor.buildIterator(StatementExecutor.java:190)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at com.j256.ormlite.stmt.StatementExecutor.query(StatementExecutor.java:134)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at com.j256.ormlite.stmt.StatementExecutor.queryForAll(StatementExecutor.java:111)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at com.j256.ormlite.dao.BaseDaoImpl.queryForAll(BaseDaoImpl.java:215)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at com.tabir.ruya.Ruya.setText(Ruya.java:46)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at com.tabir.ruya.Ruya.onCreate(Ruya.java:29)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at android.os.Handler.dispatchMessage(Handler.java:99)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at android.os.Looper.loop(Looper.java:123)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at android.app.ActivityThread.main(ActivityThread.java:4627)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at java.lang.reflect.Method.invokeNative(Native Method)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at java.lang.reflect.Method.invoke(Method.java:521)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
06-17 17:15:22.554: ERROR/AndroidRuntime(482): at dalvik.system.NativeStart.main(Native Method)
这是我使用 Dao 接口查询记录时的代码,
List<SimpleRuya> accountList = simpleRuyaDao.queryForAll();
String ruya=accountList.get(2).getRuya();
在Databasehelper
旁边我有这个代码
public Dao<SimpleRuya, Integer> getSımpleRuyam() throws SQLException {
if(simpleRuyaDao==null){
simpleRuyaDao=getDao(SimpleRuya.class);
}
return simpleRuyaDao;
}
是什么导致了这个问题?谢谢。