Hibernate error Java.lang.AbstractMethodError When you connect to SQL Server 2000

Source: Internet
Author: User
Tags log4j

Exception in thread "main" Java.lang.ExceptionInInitializerErrorat Com.wolf.execise.util.HibernateUtil.buildSessionFactory (hibernateutil.java:22) at Com.wolf.execise.util.hibernateutil.<clinit> (hibernateutil.java:10) at Com.wolf.execise.test.SessionTest.main (sessiontest.java:11) caused by:java.lang.AbstractMethodError: Com.microsoft.jdbc.base.BaseDatabaseMetaData.getDatabaseMajorVersion () Iat Org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure (jdbcservicesimpl.java:128) at Org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService ( standardserviceregistryimpl.java:111) at Org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService ( abstractserviceregistryimpl.java:234) at Org.hibernate.service.internal.AbstractServiceRegistryImpl.getService ( abstractserviceregistryimpl.java:206)at Org.hibernate.cfg.Configuration.buildTypeRegistrations (configuration.java:1887) at Org.hibernate.cfg.Configuration.buildSessionFactory (configuration.java:1845) at Com.wolf.execise.util.HibernateUtil.buildSessionFactory (hibernateutil.java:16) ... 2 More
Solutions on-line:
Java.lang.AbstractMethodError

Java.lang.AbstractMethodError:com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys () Z

LOg4j:warn No Appenders could is found for logger (org.hibernate.cfg.Environment).
Log4j:warn Initialize the log4j system properly.
Exception in thread "main" Java.lang.AbstractMethodError: Com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys () Z
At org.hibernate.cfg.SettingsFactory.buildSettings (settingsfactory.java:123)
At org.hibernate.cfg.Configuration.buildSettingsInternal (configuration.java:2119)
At org.hibernate.cfg.Configuration.buildSettings (configuration.java:2115)
At org.hibernate.cfg.Configuration.buildSessionFactory (configuration.java:1339)
At DAO. Hibernatesessionfactory.<clinit> (hibernatesessionfactory.java:31)
At DAO. Basehibernatedao.getsession (basehibernatedao.java:13)
At Hibernatedaotest.main (hibernatedaotest.java:16)

FIX: A bug exists in the database driver provided by Microsoft. A different drive connection is required, using Jtds (: http://sourceforge.net/projects/jtds/files/ Download version jtds1.2, extract the Jtds-1.2.jar, refer to the project directory in Eclipse (remove the original driver reference), change the hibernate configuration file:

Original Drive Connection configuration:

 <property name= "Connection.driver_class" >com.microsoft.jdbc.sqlserver.sqlserverdriver </property>
         <property name= "Connection.url" > JDBC: Microsoft:sqlserver ://127.0.0.1:1433;databasename=hibernate</property>
Change Jtds connection: &NBSP;&NBSP;&NBSP
        <property name= "Connection.driver_class" > Net.sourceforge.jtds.jdbc.Driver </property>
        <property name= "Connection.url" > jdbc:jtds:sqlserver ://127.0.0.1:1433;databasename=hibernate</property>

Problem solved. added: Java Code tuning Driver Connection database is no problem, with hibernate will have this problem.


In the connection mysql5.1 Normal, connection sql2000 when is not even, depressed, finally found on the Internet solution, the original is SQL driver and Hibernate compatibility problem, now the problem has been resolved, stay this article for future reference.


Source: >  

From for notes (Wiz)

Hibernate error Java.lang.AbstractMethodError When you connect to SQL Server 2000

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.