upgrading from java1.5 to java7 and from sqlserver
jdbc 4 to 6.
I altered my CLASSPATH to point to the sqljdbc41.jar found in the jre7 directory of sqljdbc_6.0 from the sqljdbc_6.0.8112.200_enu.tar
I have change dmy javac to use /opt/java7/bin/javac
I get this error:
Exception in
thread "main" java.lang.NoClassDefFoundError: com/microsoft/sqlserver/jdbc/SQLServerDataSource
However,
I know the class is there because if I try to compile with java6, it gives me this:
warning: com/microsoft/sqlserver/jdbc/SQLServerDataSource.class(com/microsoft/sqlserver/jdbc:SQLServerDataSource.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
Then I compile with java7, it compiles without warning.
But when I run the code it gives the NoClassDefFoundError
Exception in thread "main" java.lang.NoClassDefFoundError: com/microsoft/sqlserver/jdbc/SQLServerDataSource
at testms.main(testms.java:31)
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDataSource
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
I have also tried mssql-jdbc-6.2.2.jre7.jar found in sqljdbc_6.2.2.1_enu.tar
I have verified that my CLASSPATH does include the needed jar, and includes only ONE mssql jar at the time I compile.
I am running this on hpux itanium 11