Skip to main content
Known Participant
September 17, 2012
Answered

CF10 MS SQL JDBC connection

  • September 17, 2012
  • 2 replies
  • 7266 views

Hello there,

I can't make JDBC connection work with CF10 and MS SQL 2008 Express Edition. CF MS SQL Server driver works fine. I use this string to connect

jdbc:sqlserver://127.0.0.1/MyInstance:12345;databaseName=database-name, but getting error that server is not available. I tried MS JDBC driver v3 and v4, but with the same result.

May be to use MS SQL Server driver is fine, but I had some issues with it on CF8 and CF9, like it told that query was not exists. So, I had to use JDBC driver. May be it is fixed in CF10. We will see soon, if I do not solve problem above.

Thanks,

Anton

This topic has been closed for replies.
Correct answer carl type3

CF10 with this (ie default + updated):

About ColdFusion »


System Information 
Server Product  ColdFusion 
Version  ColdFusion 10,282462 
Update Level  02 
Tomcat Version  7.0.23.0 
Update Level  /C:/ColdFusion10/cfusion/lib/updates/chf10000002.jar   
JVM Details 
Java Version  1.6.0_29   

MS SQL JDBC driver fails with:

Connection verification failed for data source: NAME
java.sql.SQLException: Timed out trying to establish connection
The root cause was that: java.sql.SQLException: Timed out trying to establish connection


CF10 change Java JVM in use:

About ColdFusion »


System Information 
Server Product  ColdFusion 
Version  ColdFusion 10,282462 
Update Level  02 
Tomcat Version  7.0.23.0 
Update Level  /C:/ColdFusion10/cfusion/lib/updates/chf10000002.jar   
JVM Details 
Java Version  1.7.0_03   


Data & Services > Data Sources > MS SQL JDBC says:

data source updated successfully (ie verifies OK).


Reader beware. Why did I use Java 7? I had that Java already installed and was easy for me to flick CF10 over and use that. Adobe CF does not support Java 7 yet so it may be more advisable to use Java 6 (1.6.0_35?) tho also keep in mind Adobe CF does not officially support beyond 1.6.0_29.

HTH, Carl.

2 replies

Known Participant
September 24, 2012

Still cannot make CF10 and MS SQL JDBC driver to work together. CF9 was fine. Uninstalled it and installed CF10. Again CF MS SQL driver works fine, but JDBC driver, which worked fine with CF9, gives timeout. Cannot find any solution.

carl type3Correct answer
Legend
September 24, 2012

CF10 with this (ie default + updated):

About ColdFusion »


System Information 
Server Product  ColdFusion 
Version  ColdFusion 10,282462 
Update Level  02 
Tomcat Version  7.0.23.0 
Update Level  /C:/ColdFusion10/cfusion/lib/updates/chf10000002.jar   
JVM Details 
Java Version  1.6.0_29   

MS SQL JDBC driver fails with:

Connection verification failed for data source: NAME
java.sql.SQLException: Timed out trying to establish connection
The root cause was that: java.sql.SQLException: Timed out trying to establish connection


CF10 change Java JVM in use:

About ColdFusion »


System Information 
Server Product  ColdFusion 
Version  ColdFusion 10,282462 
Update Level  02 
Tomcat Version  7.0.23.0 
Update Level  /C:/ColdFusion10/cfusion/lib/updates/chf10000002.jar   
JVM Details 
Java Version  1.7.0_03   


Data & Services > Data Sources > MS SQL JDBC says:

data source updated successfully (ie verifies OK).


Reader beware. Why did I use Java 7? I had that Java already installed and was easy for me to flick CF10 over and use that. Adobe CF does not support Java 7 yet so it may be more advisable to use Java 6 (1.6.0_35?) tho also keep in mind Adobe CF does not officially support beyond 1.6.0_29.

HTH, Carl.

Known Participant
September 24, 2012

Carl, it works with JRE v1.6.0_35. Thanks again for the great help.

Legend
September 17, 2012

SQL Express Edition do not enable TCP protocol by default.

Run "SQL Server Configuration Manager" > SQL Server Network Configuration >

Protocols for SQL (insert your SQL instance name) > TCP/IP > Enabled. SQL Server will need restarting to apply.

HTH, Carl.

Known Participant
September 17, 2012

Thanks Carl, but TCP/IP is on. And I can connect with CF MS SQL Server driver just fine. JDBC is the issue.

Legend
September 17, 2012

Odd since CF > Data & Services > Data Sources > Microsoft SQL Server is a JDBC driver.
What happens if you pick "other" and use following example that matches your environment.

JDBC URL:
jdbc:macromedia:sqlserver://server_name:1433;databaseName=northwind

Driver Class:
macromedia.jdbc.MacromediaDriver

Regards, Carl.