Flex apps aren't installed, so for pure Flex apps, can't do it.
For AIR apps (usually written in Flex), the app is installed, but can't even directly communicate with native apps, like Apache and databases. You can use a SQLLite database with an AIR app, but you cannot install Apache with the AIR app, and apart from SQLLite, you can't install a DB with an AIR app, and others might tell you the SQLLite DB is not local, I don't know.
I think the bottom line is you can't do what you describe. You should really think of Flex/AIR apps as primarily apps that communicate with a server online, and that is where the DB is as well.
If this post answered your question or helped, please mark it as such.