I am able to connect to database which is having ip address,but if i have my database created in Azure SQL Database server in that i am not able to connect using spring configu
The connection string of Azure SQL Database for JDBC is like jdbc:sqlserver://<hostname>.database.windows.net:1433;database=<dbname>;user=<user>@<hostname>;password={your_password_here};encrypt=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;
.
You can check the connection string of your Azure SQL Database on Azure old portal or new portal, please see the pictures below.
Pic 1. Check the Connection String for JDBC on Azure old portal
Pic 2. Check the Connection String for JDBC on Azure new portal
Is 555
the port, that is exposed by the database for connection?
Shouldn't the connection string look like this?
<property name="url" value="jdbc:sqlserver://vinayaka.cloudapp.net:555\sqlexpress;database=Sample" />
I have replaced ,
in your code with :
Change your connection string like "jdbc:sqlserver://{HostName}.database.windows.net;database={databaseName};encrypt=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30". And use sqljdbc4 jar file. Hope it should work.