If you just use 'Map' you get a linked hash map implementation as a default.
This code :-
print('openDB() was executed'); /// Console control
getTheData(db);
should be inside your last 'then' statement, your accessing the db before the storage has happened.