user1825110
user1825110

Reputation: 555

Setting up jdbc in Maven project

I have been working on a maven project solely for junit tests. I have created a class to access and do simple queries against the db. Not sure if i am installing the mysql-connector-java-5.1.22-bin.jar correctly or not, here is a snippet:

/home/rick/examples/java/junit/lib/ mvn install:install-file \
    -Dfile=mysql-connector-java-5.1.22-bin.jar \
    -DgroupId=com.oracle \
    -DartifactId=oracle \
    -Dversion=10.2.0.2.0 \
    -Dpackaging=jar \
    -DgeneratePom=true

Thanks for the help everyone!

Upvotes: 0

Views: 7134

Answers (1)

Will
Will

Reputation: 6286

You can put it directly in your pom and not have to install it locally.

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.22</version>
</dependency>

See search.maven.com

Upvotes: 6

Related Questions