For Database Connections, we use JDBC Drivers. With your license to Intersystems Cache, you will have a JDBC Driver that you can load into QIE (see here). Use the "Custom" Driver option to create the proper Connection URL for the driver.
For Cache queries, I believe you will need to need to use the alternate qie.doSelectQuery() and qie.doUpdateQuery() methods, which can be found in Code Wizard > QIE System Functions > Database > Alternate Query Methods.
For using Oracle TNS names, it would be the same type of approach of relying on the JDBC implementation, and defining the connection URL.
You can manually set the connection URL and define your TNS names.
This TNS names example was found on StackOverFlow.