Look at tool as ADBC - ABAP Database Connectivity to execute SQL statement (OO substitute of native SQL statements), but first you need to actually connect database.
For Information on a tool as DB connect, look at document DB Connect Architecture and reference note 323151 - Several DB connections with Native SQL. Not that Basis will be required to install some component to access a database typedistinct from current one (e.g. access MS SQL if SAP running on Oracle)
NB: You could also perform some search on UD Connect (uses Application Server J2EE connectivity)
Regards,
Raymond