package BWP.MobileSale.Util;
import BWP.MobileSale.Config.SaleDataBase;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

public class DbUtil {
	public boolean TableExists(SQLiteDatabase db, String tableName) {
		Cursor c = db.rawQuery(
				"select * from sqlite_master where table=? limit 0,1",
				new String[] { tableName });
		return c.getCount() > 0;
	}

	public SQLiteDatabase getWritableDatabase(Context context) {
		return SaleDataBase.getWritableDatabase(context);
	}

	public SQLiteDatabase getReadableDatabase(Context context) {
		return SaleDataBase.getReadableDatabase(context);
	}

}
