对不起,noop 问题,但我只是无法缝合让它工作。我用这个命令创建了我的数据库表:
newLeaseTable = "create table '" + leaseName + "' (_id integer primary key autoincrement,"
+ " Date TEXT, StockTank1Ft NUMERIC, StockTank1Inch NUMERIC,"
+ " StockTank2Ft NUMERIC, StockTank2Inch NUMERIC, StockTank3Ft NUMERIC,"
+ " StockTank3Inch NUMERIC, StockTank4Ft NUMERIC, StockTank4Inch NUMERIC,"
+ " Change1 NUMBER, Change2 NUMBER, Change3 NUMBER, Change4 NUMBER, User TEXT);";
myDataBase.execSQL(newLeaseTable);
当我使用 rawquery 或查询语句查询数据库时,应用程序崩溃并且日志指向我的查询语句。我想在表“LeaseNames”中查找与变量字符串“enterLogLN”(来自editText)匹配的“colLeaseNames”列中的字符串,然后从同一行的“colWaterWells”列返回整数。任何人都可以帮助解决这个问题,
谢谢
在这种情况下,变量“enterLogLN”是“关于”他
re is my rawquery and logcat:
String col[] = {"colLeaseNames", "colWaterWells"};
String test = "Select * from LeaseNames Where " + col + " ='" + enterLogLN + "'";
return Cursor cRWLeaseInfo = myDataBase.rawQuery(test, null);
logcat:
Caused by: android.database.sqlite.SQLiteException: unrecognized token: "[Ljava.lang.String;@405397e0 ='about'": , while compiling: Select * from LeaseNames Where [Ljava.lang.String;@405397e0 ='about'