Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ColdFusion 11 and Azure Database

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.

like image 328
Dale Fraser Avatar asked Nov 01 '14 01:11

Dale Fraser


People also ask

What database does ColdFusion use?

ColdFusion comes with OLE DB providers for accessing MS Access and MS SQL Server. Other third-party OLE DB drivers are available from a number of vendors. Native drivers. The Enterprise version of ColdFusion comes with native driver support for DB2 5.0 and 6.1, Informix 7.

How does ColdFusion connect to database?

Set up the database in the ColdFusion AdministratorOpen the ColdFusion Administrator. Click Data & Services > Data Sources. Type northwind in the Data Source Name field, and select Microsoft SQL Server in the Driver drop-down list. Click Add.


1 Answers

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;
like image 70
Dale Fraser Avatar answered Sep 30 '22 09:09

Dale Fraser