there are several ways to connect to Database like using
JSP's with HTTP Service ,Hibernate with spring ,Remote
objects,Blaze DS etc and if you are familiar with hibernate and
remote objects,you can go with that approach. Otherwise you can use
Flex doesn't directly connect to a database -- any database.
You need a server -- PHP, JSP, .NET what have you -- that would
connect to the database get the data convert it into XML, JSON or
your favorite format and write to the HTTP Response (or web service
or remote method but you shouldn't be worried about these two
options at the moment).
Once you have server page ready to give you the data, you'll
use HTTPService class or MXML component to call this server
resource, get the data and do whatever.
A search in FlexBuilder help on HTTPService should give you
good starting point.