Code example for SQLiteDatabase

Methods: beginTransactionendTransactionexecSQLisReadOnlysetTransactionSuccessful

0
 
	@Override 
	public void onOpen(SQLiteDatabase db) {
		super.onOpen(db);
		 
		if(!db.isReadOnly()){
 
			// create table 
	        db.execSQL("create table if not exists bookmark("
        		+"_id integer primary key AUTOINCREMENT" 
        		+",uri text" 
        		+",lno int" 
        		+",fname text" 
        		+",caption text" 
        		+",ctime int" 
	        +")"); 
	         
			// create table 
	        db.execSQL("create table if not exists tmpdir("
        		+"_id integer primary key AUTOINCREMENT" 
        		+",pid integer" 
        		+",tmpdir text unique not null" 
        		+",ctime int" 
	        +")"); 
	         
	         
	         
			db.beginTransaction();
			try{ 
				db.setTransactionSuccessful();
			}finally{ 
				db.endTransaction();
			} 
		} 
	} 
	 
	static void sweep_tmpdir(Context context,SQLiteDatabase db,File tmpdir){
Contextual code suggestions in your IDE  Get Codota for Java