There’s a generic Database Connector module that allows you to do what you describe, although it will take some setup. The connector documentation page has a pretty good description of what the module can do and how:
https://docs.mendix.com/appstore/connectors/database-connector