I have a Java Enterprise
Application project which includes an Enterprise Application Client (EAC)
and a standard Java Class Library. One of the purposes of this library is to
manage the database connections and encapsulate the SQL statements. My goal was
to take away all the database code from the EAC.
The library includes the mysql driver and compiles
and packages fine. I've put this library as a dependency of the mentioned EAC
and built it.
The problem is that every time the application
client calls a method of the library (and therefore establishes a database
connection), the driver fails to load (java.lang.ClassNotFoundException:
com.mysql.jdbc.Driver). If I include
the mysql driver in the EAC package it works fine.
My question is: since I already put the mysql
driver packaged in the library, shouldn't it be enough? Why do I have to include
the driver in the EAC package?
Tks in advance.
--
Rui