Flash/Flex applications can get data from server-pages, which connect to the database. So it is indirect. It's not difficult but we don't have any guidance on that here. In Flash the simple method is Loadvars. Flex adds the HTTPService.
Wowza modules can connect to a database directly using JDBC, but I don't think you want that in this context.