RCP hibernate Derby database connection problem no suitable driver found

Source: Internet
Author: User

Severe [org. hibernate. util. jdbcexceptionreporter]: no suitable driver found for JDBC: Derby: D:/javadb/avodb66; Create = true; user = app; Password = app
Severe [Global]
Org. hibernate. Exception. jdbcconnectionexception: cannot open connection
At org. hibernate. Exception. sqlstateconverter. Convert (sqlstateconverter. Java: 74)
At org. hibernate. Exception. jdbcexceptionhelper. Convert (jdbcexceptionhelper. Java: 43)
At org. hibernate. Exception. jdbcexceptionhelper. Convert (jdbcexceptionhelper. Java: 29)
At org. hibernate. JDBC. connectionmanager. openconnection (connectionmanager. Java: 426)
At org. hibernate. JDBC. connectionmanager. getconnection (connectionmanager. Java: 144)
At org. hibernate. JDBC. jdbccontext. Connection (jdbccontext. Java: 119)
At org. hibernate. transaction. jdbctransaction. Begin (jdbctransaction. Java: 57)
At org. hibernate. impl. sessionimpl. begintransaction (sessionimpl. Java: 1326)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 597)
At org. hibernate. Context. threadlocalsessioncontext $ transactionprotectionwrapper. Invoke (threadlocalsessioncontext. Java: 301)
At $ proxy7.begintransaction (unknown source)
At events. eventtestaction. actionreceivmed (eventtestaction. Java: 19)
At org. openide. AWT. alwaysenabledaction. actionreceivmed (alwaysenabledaction. Java: 89)
At javax. Swing. abstractbutton. fireactionshortmed (abstractbutton. Java: 1995)
At javax. Swing. Sort actbutton $ handler. actionshortmed (export actbutton. Java: 2318)
At javax. Swing. defaultbuttonmodel. fireactionreceivmed (defaultbuttonmodel. Java: 387)
At javax. Swing. defaultbuttonmodel. setpressed (defaultbuttonmodel. Java: 242)
At javax. Swing. abstractbutton. doclick (abstractbutton. Java: 357)
At javax. Swing. plaf. Basic. basicmenuitemui. doclick (basicmenuitemui. Java: 1225)
At javax. Swing. plaf. Basic. basicmenuitemui $ handler. mousereleased (basicmenuitemui. Java: 1266)
At java. AWT. component. processmouseevent (component. Java: 6134)
At javax. Swing. jcomponent. processmouseevent (jcomponent. Java: 3265)
At java. AWT. component. processevent (component. Java: 5899)
At java. AWT. Container. processevent (container. Java: 2023)
At java. AWT. component. dispatcheventimpl (component. Java: 4501)
At java. AWT. Container. dispatcheventimpl (container. Java: 2081)
At java. AWT. component. dispatchevent (component. Java: 4331)
At java. AWT. lightweightdispatcher. retargetmouseevent (container. Java: 4301)
At java. AWT. lightweightdispatcher. processmouseevent (container. Java: 3965)
At java. AWT. lightweightdispatcher. dispatchevent (container. Java: 3895)
At java. AWT. Container. dispatcheventimpl (container. Java: 2067)
At java. AWT. Window. dispatcheventimpl (window. Java: 2458)
At java. AWT. component. dispatchevent (component. Java: 4331)
At java. AWT. eventqueue. dispatchevent (eventqueue. Java: 599)
At org. netbeans. Core. timableeventqueue. dispatchevent (timableeventqueue. Java: 104)
At java. AWT. eventdispatchthread. pumponeeventforfilters (eventdispatchthread. Java: 269)
At java. AWT. eventdispatchthread. pumpeventsforfilter (eventdispatchthread. Java: 184)
At java. AWT. eventdispatchthread. pumpeventsforhierarchy (eventdispatchthread. Java: 174)
At java. AWT. eventdispatchthread. pumpevents (eventdispatchthread. Java: 169)
At java. AWT. eventdispatchthread. pumpevents (eventdispatchthread. Java: 161)
At java. AWT. eventdispatchthread. Run (eventdispatchthread. Java: 122)
Caused by: Java. SQL. sqlexception: no suitable driver found for JDBC: Derby: D:/javadb/avodb66; Create = true; user = app; Password = app
At java. SQL. drivermanager. getconnection (drivermanager. Java: 602)
At java. SQL. drivermanager. getconnection (drivermanager. Java: 154)
At org. hibernate. Connection. drivermanagerconnectionprovider. getconnection (drivermanagerconnectionprovider. Java: 110)
At org. hibernate. JDBC. connectionmanager. openconnection (connectionmanager. Java: 423)
... 40 more

 

 

Problem: The Hibernate and Derby packages have been added separately. The above problem occurs.

 

 

Cause: When hibernate connects to the database session. begintransation (), it must call connection to connect to the database. hibernate cannot find the derby driver.

 

Solution: add the Derby package to the dependency under the hibernate package. Or put Derby and Hibernian in the same package.

 

 

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.