VPN is not supported in the Mendix cloud. If you are deploying on premises or in a VPC you should be able to configure the VPN at server level. In that case, calling the SQL query in Mendix would not be different, apart from a different endpoint.
Please see https://docs.mendix.com/developerportal/deploy/securing-outgoing-connections-from-your-application/ for alternate options regarding outgoing connections.