So basically, I'm having trouble connecting to SQL Server 2012 through JDBC through my tomcat web application and also SQuirreL
I've tried substituting multiple versions of sqljdbc jar files. The weird thing is, my co-worker is able to successfully connect!
Also, all jars successfully connect to a different SQL Server 2005.
SQL Server Management Studio 2005 express (on my machine) connects to both SQL Server 2005 & 2012 without issue.
Tomcat Resource setting:
<Resource auth="Container" description="a Database Connection" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" logAbandoned="true" maxActive="300" maxIdle="50" maxWait="10000" name="jdbc/SomethingPool" password="PW" removeAbandoned="true" removeAbandonedTimeout="60" type="javax.sql.DataSource" url="jdbc:sqlserver://<SOMETHING>.<DOMAIN>.com:1433;databaseName=dbname;" username="USER"/>
old SQL JDBC version (sorry, don't know how to check versions):
new SQL JDBC version (downloaded recently from http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx ):
My machine
Server:
Old Server:
Thanks!
What is the SQL Statement? Since you got this error from Tomcat (com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.) does the SQL statement work directoy in MSSQL 2012 Server Management Studio. Just try something simple like (SELECT 1) and see if that works.
On Tomcat please provide the Resource configuration. You could try using the built in connection pool that Tomcat provides.
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
Since it is a timeout you could be having a network problem. Does ping work successfully? Can you telnet to 1433 and see if a firewall is blocking your connection?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.