1

I am new to java and am currently stuck. I made a database in SQL Server and as i am using JDK 8, so i downloaded the official SQL sqljdbc4.jar file and also the required .dll file and added the .jar file to the libraries. But still i am getting this error,

Aug 27, 2015 4:34:14 PM com.microsoft.sqlserver.jdbc.SQLServerConnection SEVERE: Java Runtime Environment (JRE) version 1.8 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.

My connection code:

        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        String connectionUrl = "jdbc:sqlserver://ACER-PC\\SQLEXPRESS:49179;databaseName=EduHub;integratedSecurity=true";
        Connection con = DriverManager.getConnection(connectionUrl);
1or0_
  • 31
  • 1
  • 7
  • Do you really need original Microsoft driver? I suggest to use jtds driver instead: http://mvnrepository.com/artifact/net.sourceforge.jtds/jtds It supports Java 8 – Alex Salauyou Aug 27 '15 at 11:13
  • @SashaSalauyou I tried using jtds as well, but i am still getting the same error. – 1or0_ Aug 27 '15 at 15:59
  • Hmm.. I'm using Java 8 + SQL Server 2012 + JPA Hibernate and everything goes okay with jtds driver... – Alex Salauyou Aug 27 '15 at 17:52
  • 1
    You probably have both sqljdbc.jar **and** sqljdbc4.jar on your classpath. You should have only one of them, also see this answer for download links: http://stackoverflow.com/a/32250547/466862 – Mark Rotteveel Aug 29 '15 at 07:49

0 Answers0