Back to project page cnBeta.
The source code is released under:
Apache License
If you think the Android project cnBeta listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.guest.cnbeta.database; /*from ww w . j a v a2 s . com*/ import android.content.Context; import android.database.sqlite.SQLiteDatabase; public class BaseDB { private BaseDBHelper dbHelper; protected SQLiteDatabase db; public BaseDB(Context context) { if (dbHelper == null) { dbHelper = new BaseDBHelper(context, "db.db", null, 1); } if (db == null) { db = dbHelper.getWritableDatabase(); }else { dbHelper.close(); } } protected String toSafeString(String str) { try { str = str.replace("'", "''"); } catch (NullPointerException e) { // TODO: handle exception e.printStackTrace(); } return str; } }