Code example for SQLiteDatabase

Methods: beginTransactionendTransactionexecSQLsetTransactionSuccessful

0
	    	 
	@Override 
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	   	if (oldVersion == 1 && newVersion == 2) {
	   		// ������ ��� ������� ���������� 
	        db.beginTransaction();
	        try { 
	           	// ������� ������� allreports � ������ 
	    	   	db.execSQL("create table allreports ("
	    	   			+ "_id integer primary key autoincrement,"  
	    	   			+ "login text," 
	    	   			+ "date text," 
	    	   			+ "typeofactivities text," 
	    	   			+ "nameofproject text," 
	    	   			+ "info text," 
	    	   			+ "time text" + ");"); 
	    	   	db.setTransactionSuccessful();
	        } 
	        
	        finally { 
	        	db.endTransaction(); 
	    	} 
	    } 
	} 
	 
}