Hibernate connection to SQL Server issues

Source: Internet
Author: User

Damn, the boss called to get to SQL Server recently.

Well, it's easy, hibernate, just change the configuration.

I've been looking for a driver bag or something.

Database with SQL Server client is no problem. (The connection string under the slot, the other side of the end of the face are added: The number of Microsoft to get a, number)

And then use the MyEclipse to connect to the mapping entity also no problem (this function is only to reduce the workload, but the map has to manually change the change)

At the end of the program to connect the problem:

Java.lang.AbstractMethodError:com.microsoft.jdbc.base.BaseDatabaseMetaData.getJDBCMajorVersion () I

There is a situation on the Internet:

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

It is said that there is a bug in the SQL Server database driver provided by Microsoft (Microsoft). (Note: Java code Source-driven connection to the database is no problem, collocation hibernate will have this problem.) ----people say that. I haven't tried it. Non-hibernate mode, to be verified) need to change a drive connection, use Jtds this drive, it can be.

Configuration change is OK:

Net.sourceforge.jtds.jdbc.Driver

jdbc:jtds:sqlserver://Database IP: port; databasename=xxx

Jtds Download Address: http://sourceforge.net/projects/jtds/files/

By the way, the latest version of Jtds may require JDK7 support.

If you're using a lower version, you might want to jtds a little older.

For example, I use the jdk1.6 I can only use jtds1.2 after 1.3 will be an error:

java.lang.unsupportedclassversionerror:net/sourceforge/jtds/jdbc/driver:unsupported Major.minor version 51.0

It would be nice to use a lower Jtds version of this error.

As for the online version of the JDK, the general development will not easily change the JDK version of the

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.