Code example for SQLException

Methods: getMessage

0
        	try { 
	            db.execSQL("ALTER TABLE history ADD COLUMN latitude INTEGER NULL;");
	            db.execSQL("ALTER TABLE history ADD COLUMN longitude INTEGER NULL;");
	            db.execSQL("ALTER TABLE history ADD COLUMN site_id INTEGER NULL;");
        	} catch (SQLException e) {
        		Log.e(TAG, "Upgrade to version 6 failed, " + e.getMessage());
        		return false; 
        	} 
        	 
            return true; 
        } 
 
        private boolean upgradeToVersion5(SQLiteDatabase db) {
        	try { 
	            db.execSQL("DROP TABLE IF EXISTS history");
	            onCreate(db);
        	} catch (SQLException e) {
        		Log.e(TAG, "Upgrade to version 5 failed, " + e.getMessage());
        		return false; 
        	}