android sqlite关于数据表的问题 androidSQLite数据库sqlitedatabase 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 SQLiteDatabase db = localbook.getWritableDatabase(); for (int i = 0; i < insertList.size(); i++) { try { if (insertList.get(i) != null) { String s = insertList.get(i).get("parent"); String s1 = insertList.get(i).get("path"); String sql1 = "insert into " + "localbook" + " (parent,path" + ", type" + ",now,ready) values('" + s + "','" + s1 + "',2,0,null" + ");"; db.execSQL(sql1); } } catch (SQLException e) { Log.e(TAG, "setApprove SQLException", e); } catch (Exception e) { Log.e(TAG, "setApprove Exception", e); } } db.close(); } PS:我的插入语句是写在AsyncTask的doInBackground中的。 SQLiteDatabase db = localbook.getWritableDatabase(); for (int i = 0; i < insertList.size(); i++) { try { if (insertList.get(i) != null) { String s = insertList.get(i).get("parent"); String s1 = insertList.get(i).get("path"); String sql1 = "insert into " + "localbook" + " (parent,path" + ", type" + ",now,ready) values('" + s + "','" + s1 + "',2,0,null" + ");"; db.execSQL(sql1); } } catch (SQLException e) { Log.e(TAG, "setApprove SQLException", e); } catch (Exception e) { Log.e(TAG, "setApprove Exception", e); } } db.close(); }插入第二张表的代码和这个一样? SQLiteDatabase db = localbook.getWritableDatabase(); for (int i = 0; i < insertList.size(); i++) { try { if (insertList.get(i) != null) { String s = insertList.get(i).get("parent"); String s1 = insertList.get(i).get("path"); String sql1 = "insert into " + "localbook" + " (parent,path" + ", type" + ",now,ready) values('" + s + "','" + s1 + "',2,0,null" + ");"; db.execSQL(sql1); } } catch (SQLException e) { Log.e(TAG, "setApprove SQLException", e); } catch (Exception e) { Log.e(TAG, "setApprove Exception", e); } } db.close(); }插入第二张表的代码和这个一样?表名换了呀,是localbook4 代码没看出什么问题,你确定localbook4中插入时db.execSQL(sql1);被执行了吗? BaseAdapter如何添加一个TextView Android APP如何实现关机和重启? 求解,为什么点按键有反应,点gridview没反应 发不了贴 unity3d 水滴落水效果 NDK_DEBUG=1 情况下 无法生成.so文件...求解救... java.lang.VerifyError: com/example/weipan/utils/OAuth 泛型方法的封装 Android studio 运行错误 Android Studio 布局layout 无显示 求助listview展开子child问题 [福音][散发]从github下载Android最新源码
for (int i = 0; i < insertList.size(); i++) {
try {
if (insertList.get(i) != null) {
String s = insertList.get(i).get("parent");
String s1 = insertList.get(i).get("path");
String sql1 = "insert into " + "localbook"
+ " (parent,path" + ", type"
+ ",now,ready) values('" + s + "','" + s1
+ "',2,0,null" + ");";
db.execSQL(sql1);
}
} catch (SQLException e) {
Log.e(TAG, "setApprove SQLException", e);
} catch (Exception e) {
Log.e(TAG, "setApprove Exception", e);
}
}
db.close();
}
for (int i = 0; i < insertList.size(); i++) {
try {
if (insertList.get(i) != null) {
String s = insertList.get(i).get("parent");
String s1 = insertList.get(i).get("path");
String sql1 = "insert into " + "localbook"
+ " (parent,path" + ", type"
+ ",now,ready) values('" + s + "','" + s1
+ "',2,0,null" + ");";
db.execSQL(sql1);
}
} catch (SQLException e) {
Log.e(TAG, "setApprove SQLException", e);
} catch (Exception e) {
Log.e(TAG, "setApprove Exception", e);
}
}
db.close();
}插入第二张表的代码和这个一样?
for (int i = 0; i < insertList.size(); i++) {
try {
if (insertList.get(i) != null) {
String s = insertList.get(i).get("parent");
String s1 = insertList.get(i).get("path");
String sql1 = "insert into " + "localbook"
+ " (parent,path" + ", type"
+ ",now,ready) values('" + s + "','" + s1
+ "',2,0,null" + ");";
db.execSQL(sql1);
}
} catch (SQLException e) {
Log.e(TAG, "setApprove SQLException", e);
} catch (Exception e) {
Log.e(TAG, "setApprove Exception", e);
}
}
db.close();
}插入第二张表的代码和这个一样?表名换了呀,是localbook4