When connecting to a SQL Azure Database, you should connect to the master database to call SQLServerDatabaseMetaData.getCatalogs.
SQL Azure Database does not support returning the entire set of catalogs from a user database. SQLServerDatabaseMetaData.getCatalogs uses the sys.databases view to get the catalogs. Please refer to the discussion of permissions in sys.databases (SQL Azure Database) to understand SQLServerDatabaseMetaData.getCatalogs behavior on a SQL Azure Database.
When connecting to a SQL Azure Database, idle connections may be terminated by a network component (such as a firewall) after a period of inactivity. There are two types of idle connections, in this context:
Idle at the TCP layer, where connections can be dropped by any number of network devices.
Idle by the SQL Azure Gateway, where TCP keepalive messsages might be occurring (making the connection not idle from a TCP perspective), but not had an active query in 30 minutes. In this scenario, the Gateway will determine that the TDS connection is idle at 30 minutes and terminate the connection.
To avoid dropping idle connections by a network component, the following registry settings (or their non-Windows equivalents) should be set on the operating system where the driver is loaded:
Appending the Server Name to the UserId in the Connection String
Prior to the 4.0 version of the Microsoft JDBC Driver for SQL Server, when connecting to a SQL Azure Database, you were required to append the server name to the UserId in the connection string. For example, user@servername. Beginning in version 4.0 of the Microsoft JDBC Driver for SQL Server, it is no longer necessary to append @servername to the UserId in the connection string.
Using Encryption Requires Setting hostNameInCertificate
When connecting to a SQL Azure Database, you should specify hostNameInCertificate if you specify encrypt=true. (If the server name in the connection string is shortName.domainName, set the hostNameInCertificate property to *.domainName.)