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());
}
阅读(695) | 评论(0) | 转发(0) |