Skip to main content
vksrinu
Inspiring
June 26, 2014
Answered

java.sql.SQLException: Timed out trying to establish connection

  • June 26, 2014
  • 1 reply
  • 5953 views


I am trying to connect to SQL Server 2012 with flag MULTISUBNETFAILOVER=TRUE


I have created the DSN and it works fine for some time and next day i will get the below erorr. I have verified the DB server and its up and working fine and able to connect to it from management studio. Once I restart the server the issue get fixed. Does any one had any idea on why this issue is happening. I am using the sqljdbc4.jar for this connection.


The root cause was that: java.sql.SQLException: Timed out trying to establish connection

This topic has been closed for replies.
Correct answer Carl Von Stetten

yes, the fields are char(x) and nchar(x) fields.

we have many files/modules which is difficult to put trim, so we are calling custom tag and trying to trim the data.

we are passing the query to customer and executing the query in custom tag with cfquery and trying to do trim by using the QoQ as it trims the data.


Again, I don't believe QofQ supports the Trim function.  In fact, the only place Trim appears on the QofQ page in Adobe docs is to indicate it is a reserved word and shouldn't be used.

As far as I can see, you only have two choices here: modify your database queries to use TRIM before running your QofQ, or change the database colums from char(x) and nchar(x) to varchar(x) and nvarchar(x).  Unless this or other applications are relying on fixed character length fields, switching to varchar(x)/nvarchar(x) shouldn't result in any data loss or adverse side effects.

-Carl V.

1 reply

Carl Von Stetten
Legend
June 26, 2014

Which version (Standard, Enterprise, Developer) and release (9, 10, 11) of CF are you using, and on what OS?

Also, what is the entire JDBC connect string you are using?

-Carl V.

vksrinu
vksrinuAuthor
Inspiring
June 27, 2014

I am using CF9 on Linux OS and trying to connect to SQL Server 2012 Alwayson.

my DSN created with build in driver always gets time out in the next day. but the DSN which i have created with the below URL, works fine.

below is the JDBC URL i am using.

jdbc:sqlserver://DBSERVER1;user=user1;password=xxxx;database=reporting;MULTISUBNETFAILOVER=TRUE

Priyank Shrivastava.
Inspiring
July 1, 2014

Hi Srinivas,

ColdFusion 9 does not support SQL Server 2012, please check the support matrix, the CF 9 was tested and verified for SQL 2012 server.

https://wwwimages2.adobe.com/content/dam/Adobe/en/products/coldfusion/pdfs/coldfusion9-support-matrix-4-ue.pdf

Thanks,

Priyank

Thanks, Priyank Shrivastava