Use the New JDBC Driver for MS SQL Server
I’ve used MySQL with my example on my Hibernate posts but since we are using MS SQL Server 2000 in my class(I know, we should be upgrading to at least SQL Server 2005…) I thought I’d create an example using SQL Server.
So there I was reconstructing everything that I mentioned starting with Java Persistence with Hibernate Part 2 – Getting Started until I was done with my test class to see if everything works and that’s what I was expecting but I was wrong. Instead I got this error:
Exception in thread "main" java.lang.AbstractMethodError: com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys()Z
I immediately blamed the JDBC driver I have for SQL Server 2000 and then I also remembered that there’s a new JDBC version already for SQL Server. Sure enough when I changed to sqljdbc4.jar(I’m using JDK 6.0, use sqljdbc.jar for JDK 5.0) and changed the driver class to com.microsoft.sqlserver.jdbc.SQLServerDriver everything went smoothly and the application executed correctly.
Hope this helps someone cause it’s really hard to find the solution for the error that I encountered if you’re not familiar with the history of JDBC with SQL Server. For more information on using the new driver please visit Using the JDBC Driver.

Man, thanks for posting this!! you really helped me. I would not have solved it myself. Greetings from Catalonia
No problem
HUGE help!! Thanks for publishing your findings.
Glad this post helped!
Pretty good help. Thanks! – solved my problem
You’re welcome!
Did you change your database to 2005 or did these drivers worked with 2000 it self
Hi Mohan,
The drivers worked with 2000.