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.