ORACLE: Analysis of unknown Oracle major version [11] exceptions

Source: Internet
Author: User

Recently, I encountered this problem when using spring 2.0 + hibernate 3.1 + myeclipse6.5 to integrate development projects. The exception is as follows:
 

 

It is very big, and when hibernate ing is used to reverse, this error will also be reported,

This is actually related to the dialect (dialect) configuration of hibernate! That is to say, its judgment should be like this logic:
That is to say, its judgment should be like this logic:
Mappers. Put (
"Oracle ",
New databasedialectmapper (){
Public String getdialectclass (INT majorversion ){
Switch (majorversion ){
Case 8: Return oracle8idialect. Class. getname ();
Case 9: Return oracle9idialect. Class. getname ();
Case 10: Return oracle10gdialect. Class. getname ();
Default: Throw new hibernateexception ("unknown Oracle major version [" + majorversion + "]");
}
}
}
); Exactly one project development environment uses Oracle 11 GB. This problem is also encountered.
You can see from the code above, only 10 Gb support.
Later, after some research, we found that if it is a standard 11 GB, it is also supported to use a 10 Gb dialect for dialect-related areas in the datasource-related xml configuration. The configuration is as follows:
<Property name = "hibernateproperties">
<Props>
<Prop key = "hibernate. dialect">
Org. hibernate. dialect. oracle10gdialect
</Prop>
</Props>
</Property> you have noticed the version. If you use Oracle9i, you can change it to oracle9idialect.
Of course, from the code above, this problem is not necessarily the only cause. We can see that Oracle's JDBC driver also supports org. hibernate. dialect. Use the ojdbc14.jar driver. The 12-version driver does not support dialect very well. There may be operational problems when you configure database connections. In any case, no matching dialect is found.

 

There is also a kind of worry-free database that must be added to the database connection.
Otherwise, the error "unknown Oracle major version [11]" will be cracked.

After the problem is solved, Xiaofeng continues to write code later.

Haha, the cat is cute.

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.