Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reverse Engineering SQL Server 2005 DB

 
Manny Garcia
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I've been playing with Hibernate on my MySQL db at home quite successfully for a little while and have really played it up the da boss. Unfortunately, he decided to listen to me and now I have to get it to connect to a SQL Server DB but am having a heck of a time. Specifically, I'm attempting to recreate my reverse engineering test that worked in MySQL on a SQL Server 2005 db without success.

I took the ant script that worked for MySQL, and wrote a new hibernatetest.db.properties file with the following body:
hibernate.dialect = org.hibernate.dialect.SQLServerDialect
hibernate.connection.driver_class = com.microsoft.jdbc.sqlserver.SQLServerDriver
hibernate.connection.url = jdbc:sqlserver://192.168.11.10:1433;forwardReadOnlyMethod=serverCursor
hibernate.connection.username = xxxxxxxxxxx
hibernate.connection.password = xxxxxxxxxxx
==================================================

The error message that I get when I try to reverse engineer the db is the following:

BUILD FAILED
java.lang.NoClassDefFoundError: com/microsoft/jdbc/base/BaseDriver at java.lang.ClassLoader.defineClass1(Native Method)
==================================================

The problem here is that the driver name that I gave in the property file was com.microsoft.jdbc.sqlserver.SQLServerDriver and I'm getting a NoClassDefFoundError for com.microsoft.jdbc.base.BaseDriver . So I think I'm using the wrong driver. So, where do I get the right driver and what do I call it?

Regards,

Manny
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using the old 2000 driver? It had threee Jar files if I remember right. If you want to use it, make sure you've got all the files you need on your classpath.

You could just use the newer (and far better) 2005 driver. Or you could use the event better still jTDS.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic