忘了补充一点,使用mysql作为数据库!

解决方案 »

  1.   

    噢,,你把hibernate目录里的Hibernate2.jar和lib目录里的所有jar包含到你的项目里,然后再把你下载的hibernate包里的src目录里的hibernate.properties这个文件考到你项目的src的跟目录里。
    下面给出hibernate.properties文件里连接sqlserver数据库的配置## MS SQL Server jtds0.71  hibernate推荐使用jtds访问mssqlserver数据库,下面的微软的驱动hibernate不推荐使用。hibernate.dialect net.sf.hibernate.dialect.SybaseDialect
    hibernate.connection.driver_class net.sourceforge.jtds.jdbc.Driver
    hibernate.connection.username sa
    hibernate.connection.password sa
    hibernate.connection.url jdbc:jtds:sqlserver://localhost:1433/Plans;SelectMethod=cursor## MS SQL Serverhibernate.dialect net.sf.hibernate.dialect.SybaseDialect
    hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver
    hibernate.connection.username sa
    hibernate.connection.password sa
    hibernate.connection.url jdbc:microsoft:sqlserver://localhost;DatabaseName=HYPlans;SelectMethod=Cursor