Hibernate and Oracle 11g problem ____oracle

Source: Internet
Author: User

I sent a blog post two days ago. Win7 started Oracle error, so I installed the latest version of Oracle oracle11g, this may be because I am more interested in Win7, otherwise I do not want to use a high version of Oracle installed to install, Knowing the Oracle installation process is also cumbersome, and it's also very large and takes up space. But this time I was powerless, various methods have tried, can be said to be out of the way, on an Oracle 10g I have repeatedly installed several times.

Finally I spent a few days of my time to finally oralce11g download came, the network is not good, no way. Fortunately kung Fu, I finally put it to download down, download the end of that moment really called a thrill ah. Do not say anything, but also wait for what, install it. So I put it up, eh. The installation of the interface also changed, OH, I know this is a high edition. Finally installed, but also build their own needs of several users, casually write a few SQL, Ah, the effect is good, you can sleep a safe sleep.

This morning, I have a bit of free time, anyway, other less urgent things I am too lazy to get, so we are doing the system of the database table to my Computer Oracle restore a bar, in fact, very easy, ah or yangaoshoudi, unexpectedly let me do nearly two hours, really ashamed to say. Just as I have to brush up again. OK, now the database table and data are also restored, and then is the test system in the machine, alas, the trouble began from this. A run, not up, oh, forgot to change the database connection. Change good, then run, or not up, my face began to change, my heart is a little bit creepy. Take a closer look at the log:

caused By:org.hibernate.HibernateException:unknown Oracle major version [11]
At Org.hibernate.dialect.dialectfactory$1.getdialectclass (dialectfactory.java:150)

Oh, my God, I know what's going on. The high version of the trouble Ah. This can be oracle11g, very easy, download the JDBC driver is not OK. Well, it's reasonable to change the latest JDBC driver to solve the problem. Open Google, this can be found in Oracle's official website Resources Http://www.oracle.com/technology/global/cn/software/tech/java/sqlj_jdbc/htdocs /jdbc_111060.html

This address can be downloaded from each version of the Oracle driver. Directly download a not just OK. But the download also wants the user name and the password, you said oralce so the Cow X's company also really is the fucking ah, does not download a 1M many drive. You want ye to log in, I will log in, but not on board, two Deng also did not board, and a few log also not on, retrieve the password bar, the official website of this service also stopped, then register an account number, a look at that complex filling steps, hey, forget it, I still find another way to him. So continue to Google, will find a data, is on the csdn, the upload of the classmate is also very fucked, but also to use 3 points to download, I was so a bit, hey, bite the teeth to download it. Well, supposedly this time to replace the latest driver, the program should run up the bar. All things cannot be taken for granted, but there are other problems to solve this problem. Or can not start, may be now used Hiberate version does not support Orable 11g, then find a new hibernate version of it.

I see the version of the hibernate in use is: 3.2.6.ga, estimated this version is older, and then downloaded the most version of the 3.6.0.Final version, introduced it depends on the jar, a run and error:

Critical: Error while registering Oracle JDBC diagnosability MBean.
Javax.management.MalformedObjectNameException:Invalid character '
' in the value part of the property
  & nbsp At Javax.management.ObjectName.construct (objectname.java:602)
    at Javax.management.ObjectName. (objectname.java:1403)
    at Oracle.jdbc.driver.OracleDriver.registerMBeans (oracledriver.java:303)
     at Oracle.jdbc.driver.oracledriver$1.run (oracledriver.java:213)
    at Java.security.AccessController.doPrivileged (Native)
    at Oracle.jdbc.driver.OracleDriver. (oracledriver.java:209)
    at JAVA.LANG.CLASS.FORNAME0 (Native method)
    at Java.lang.Class.forName ( class.java:169)

This is really troublesome, various methods have tried Ah, how still not. And then change the JDBC back to the original how. Try again, JDBC again change back Ojdbc14.jar, run again, Miracle appeared, it ran up. Such a simple question, unexpectedly toss me a half to death, perhaps at the beginning of the problem to the wrong location, should have thought is hibernate support Oracle problem. In any case, the problem has finally been solved.

Summary: When using the ORACLE11G database, Hibernate must be in the latest version: 3.6.0.Final, JDBC driver does not have to update.

Download Hibernate 3.6 Related resources: Hibernate-distribution-3.6.0.lib.zip

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.