How can one know if the JDBC connection to an SQL server is secure (i.e. uses SSL) or not?
Is it obvious for example from the URL. Do all JDBC drivers support SSL
In my opinion, a fast, secure and vendor neutral way of ensuring an SSL connection between your client and your server is to use s-tunnel.
s-tunnel (sometimes also called "stunnel") gives you lots of flexibility, such as mutual authentication etc, and still allows applications installed on the DB Server to communicate with it via a non-SSL connection (SQL Server for example allows connections in three modes (SSL OFF, SSL Optional, or SSL Only).
Using s-tunnel your connection would be routed something like this:
jdbc -> local s-tunnel port -> server's s-tunnel port -> server's database port.
By setting stunnel with the relevant firewall rules you can have confidence that remote connections to the DB are using SSL.