Eclipse: java.lang.UnsupportedClassVersionError: Bad version number in .class file

While programming for a small project under Eclipse IDE, I got the following error message: java.lang.UnsupportedClassVersionError: Bad version number in .class file The problem is the compilation JRE and running JRE are not the same. So we need to make them the same version, e.g. 1.6. There also might be the JRE library in your … Read more

Java code for connecting MS SQL Server by using SQL Server Authentication

First of all, You will need to add a jar file to your project library as SQL Server 2000 Driver for JDBC Service. My target is SQL Server 2000, it will require the jar file called “sqljdbc4.jar”. This is not supported on Microsoft website now, you can download it here. For other versions of SQL Server, here is the link of SQL Server 2000 Driver for JDBC Service.

The following is the code for connection MS SQL Server and select some records from a testing table.

Read more