Lib directory and dependencies

I've just created a Hibernate Java Project and I see that IntelliJ Idea creates a lib directory with some usefull jars inside and a src directory to write your code.
When I tried to connect to my local mysql database IntelliJ downloaded the mysql-connector-java-5.1.22-bin.jar and I've told it to place it in this lib directory.
When I tried to use this driver in my hibernate.cfg.xml IntelliJ Idea couldn't find a class I wanted and the problem solved only when I manually declared this jar as a module dependency.
What exactly does this declaration does?
Does it extract the jar file somewhere?
Thank you.

1 comment
Comment actions Permalink

JDBC driver jar is required on runtime by your app so you may simply add it as Runtime dependency.
Data source configuration is a separate thing so the downloaded driver is not automatically added to the project dependencies.

0

Please sign in to leave a comment.