The portlet would query the database just like any other J2EE UI would. If you're using straight JDBC, you just configure a Data Source on your application server, write code to do a JNDI lookup for that Data Source, and grab your connections from it.
