try {
InputStream in = mContext.getAssets().open("update_cities.sql");
SQLiteDatabase database = getWritableDatabase();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(in));
String sqlUpdate = null;
while ((sqlUpdate = bufferedReader.readLine()) != null) {
if (!TextUtils.isEmpty(sqlUpdate)) {
database.execSQL(sqlUpdate);
}
}
bufferedReader.close();
in.close();
} catch (SQLException e) {
XLog.log(TAG, e.getMessage());
} catch (IOException e) {
XLog.log(TAG, e.getMessage());
}
阅读(8014) | 评论(1) | 转发(1) |