Just to be sure, I deleted one DAO and worked with only one GeneralDao to connect to the MySQL database.
The GeneralDao is an abstract class and the UserDao extends this class.
When calling UserDao from an TestDao class (containing a main() method), everything works fine and I can select data from the MySQL database.
When calling UserDao from the JSF web application I always get “class not found error”. Neverteless, the classes were all in the same Java web project inside MyEclipse.
The solution was on one of the MyEclipse forums. I found it right here :
https://www.genuitec.com/forums/topic/myeclipse-tomcat-common-libs/
I was working with the Tomcat server who comes with MyEclipse. What I had to do, was the following:
– go to MyEclipse – preferences
– go to servers – integrated Sandbox
– choose “MyEclipse Tomcat 6”.
– you will see 3 options : JDK – Launch – Paths
– choose Paths.
Then I clicked the button “add JAR/ZIP” under the title “append to classpath”.
I browsed until I found the executable Jar file from the MySQL connector.
After adding, I restarted the Tomcat server and this time I could connect to the database.
I hope this thread can help others having the same problem. And frankly, I found the solution also under another thread.
[/url]