5

I cant get ColdFusion to connect to an Azure Database. We have an old ColdFusion based admin routine that requires a datasource and we are moving from aws to azure.

After reading online, it seems it wont work unless you use an Other datasource and jdbc driver and settings. However in ColdFusion 11, it just wont validate and tells me

Connection verification failed for data source: MyData
 com.microsoft.sqlserver.jdbc.SQLServerException: The connection string contains a badly formed name or value.
 The root cause was that: com.microsoft.sqlserver.jdbc.SQLServerException: The connection string contains a badly formed name or value.

Ive tried lots of combinations and cant get it to work. Has anyone got this working and have an example connection string.

Dale Fraser
  • 4,623
  • 7
  • 39
  • 76

2 Answers2

11

I finally worked it out. The examples I found online were wrong. Below are the settings you need. You will need to download the latest jdbc drivers from Microsoft and put the jar files into the lib directory of your ColdFusion installation (or in the CF classpath) and restart the CF server first.

  • DataSource Type: Other
  • Driver Class: com.microsoft.sqlserver.jdbc.SQLServerDriver
  • Driver Name: Microsoft SQL Server Azure
  • JDBC URL: jdbc:sqlserver://YOURSERVERNAME.database.windows.net:1433;databaseName=YOURDATABASENAME;user=YOURUSERNAME@YOURSERVERNAME;password=YOURPASSWORD;
Leigh
  • 28,765
  • 10
  • 55
  • 103
Dale Fraser
  • 4,623
  • 7
  • 39
  • 76
  • You will need to download the latest jdbc drivers from microsoft and put the jar files into the lib directory of your coldfusion installation also. – Dale Fraser Nov 01 '14 at 08:33
0

Another approach, possibly the least amount of work. Create an ODBC socket on the local machine and point the Coldfusion data source type: ODBC socket at that azure ODBC configuration.