[Java 7 SE+MySQL+NetBeans 7.2.1]No driver found exception question
Dear Sirs and Madams!
Our software project in NetBeans consists of three subprojects:
- Application A
- Application B
- Common Library with utility function, used in both Application A and Application B.
Now, both Application A and Application B access the mysql database with mysql connector, included in both Application A and Application B as library (and they work without problems in means of connecting to database and fetching/writing data from/into the mysql db). Now, because of centralization of system (there are still 6 apps coming into our software projects) and project management will get messy, so I have decided to move mysql connector to Common Library, so it can be used by all apps. It also simplifies source code archiving with Subversion. But now, if I try to launch Application A or Application B or both, I get following error:
Now, it is clear app cannot find driver, how do I tell the Application, that the library resided now inside Common Library?
java.sql.SQLException: No suitable driver found jdbc:mysql:
Re: [Java 7 SE+MySQL+NetBeans 7.2.1]No driver found exception question
Netbeans projects usually result in an archive at the end.
That is a jar file, or a war/ear (something to be deployed).
This is what software like Ivy or Maven is for, dependency management.
You don't stick all your jars in a single "pseudo app", like your common library, but each application defines its own dependencies.
Since you're changing how you manage your projects I would seriously consider looking into some form of dependency management.