query function

Execute a SQL statement on a database connection.