Click here to Skip to main content
15,867,488 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I developed a Java Application to run on Mac BigSur. I used Java Derby as database for this application. The Application gives an Exception:
Java
java.lang.ClassNotFoundException:org.apache.derby.jdbc.EmbeddedDriver

The interesting fact is that When I run this application on my MacBigSur(Which I have installed on Virtual Box) then the application runs perfectly. But when I run the application on Physical Mac BigSur, then it gives the above mentioned exception.
I am pasting the code Iused for Creating connection to Database.

Java
String dbdriver = "org.apache.derby.jdbc.EmbeddedDriver";
Class.forName(dbdriver).newInstance();
con = DriverManager.getConnection("jdbc:derby:/users/daniyalumar/4DSOFTECHDB; create = true");


What is the cause of this problem

What I have tried:

I have tried internet search, and the posts only show that it may the syntax problem in connection String. But I am Confused that Why the Same Syntax is working perfectly on Mac Big Sur (Running on Virtual Box) but giving exception on Actual Physical Mac?
Posted
Comments
Richard MacCutchan 14-Nov-22 11:10am    
There is probably some difference between the two systems. The most likely cause is the location of the library and the settings that the jvm uses to locate the driver. But there is no way anyone here can diagnose that for you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900