Java Hibernate with SQL Server 2012 not working?

后端 未结 2 2058
孤独总比滥情好
孤独总比滥情好 2020-12-06 12:52

I have a Java Hibernate project configuration which worked with SQL Server 2008 R2, now with a new OS 8.1 (from 7) and SQL Server 2012 (express), I\'m unable to connect to S

2条回答
  •  执念已碎
    2020-12-06 13:38

    It appears that jTDS has some issues with SQL Server 2012 (update 2?) or something has changed in 2012/8.1 which previously worked in 2008 R2/7.

    Using nearly the same configuration as above with a couple minor changes, I downloaded and changed the datasource.properties to use Microsoft JDBC Driver 4.0 for SQL Server.

    jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
    jdbc.url=jdbc:sqlserver://localhost:1433;
    #jdbc.url=jdbc:sqlserver://localhost\dbname:1433;
    

    I just put the sqljdbc4.jar in tomcat\lib\ to verify that the MS JDBC driver 4.0 works with SQL Server 2012 with all updates and it works perfectly. The dialect org.hibernate.dialect.SQLServerDialect worked in 2012 too.

提交回复
热议问题