public boolean updateSong(DBSong song){
        // Skip updating is the song is not dirty
        if(!song.isDirty())
            return true;
        
        String updateSongSQL = DatabaseHelper.SQLBuilder(updateSongSQLTemplate,
                                                         song.getSongParams());
        
        try {
            Statement stmt = dbConn.getDBConnection().createStatement();
            stmt.execute(updateSongSQL);
            
            for(DBMetaData meta : song.getDBMetaData()){
                if(meta.isNewField()){
                    String insertSongMetaSQL = DatabaseHelper.SQLBuilder(
                                                    insertSongMetaSQLTemplate,
                                                    meta.getMetaDataParams());
                    stmt.execute(insertSongMetaSQL);
                    meta.markNotNew();
                } else if(meta.isDirty()){
                    String updateSongMetaSQL = DatabaseHelper.SQLBuilder(
                                                    updateSongMetaSQLTemplate,
                                                    meta.getMetaDataParams());
                    stmt.execute(updateSongMetaSQL);
                    meta.markClean();
                }
            }
            
            stmt.close();
            song.markClean();
        } catch (SQLException e) {
            System.err.println("Could not update the song in the database.");
            e.printStackTrace();
            return false;
        }
        return true;
    }