How to run a sql on a different server from cache itself

what class or API I shall be using to execute a piece of sql to another server from one server? From within cache itself not java or python or any other languages.

 

Anything like $System.SQL.%Connect(...) ?

Answers