我正在尝试连接Azure mysql数据库。如果我使用本地服务器(Eclipse)的应用程序,它将连接到Azure MySql数据库,一旦应用程序部署在azure托管数据库字符串中不起作用。
//connecting to Azure MySql Database from local Application(Eclipse)
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://Hostname:Port/databasename", "username", "password");
//connecting to Azure MySql Database After Deploying Application in Azure(Microsoft Azure)
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
con = DriverManager.getConnection("jdbc:sqlserver://Hostname:Port;DatabaseName=databasename;","username","password");
有谁能告诉我如何为主机应用程序编写连接字符串?