I am using eclipse with the maven 2 plugin.
I want to add the dependency for sqljdbc4, how can I do that?
Can't seem to find it via the 'add dependency' option in eclipse?
If sqljdbc4 is the Microsoft SQL Server JDBC Driver, then you will very likely not find it in any "public" repository because of licensing issues.
So you'll have to download it, unpack it and install it manually with either mvn install:install-file (or mvn deploy:deploy-file if you have a repository manager).
Another option would be to use jTDS (which is open source and available in maven central repository) if your database engine is supported.
Suppose your SQL server jar is sqljar-1.4.2.jar
Use the follwing command in maven cmd
mvn install:install-file -DgroupId=com.org.sqlserver -DartifactId=sqljar -Dversion=1.4.2 -Dpackaging=jar -Dfile="C:\sqljar-1.4.2.jar"
will install the sqljar in your local maven repository .
and then include follwing dependency in your pom.xml
<dependency>
<groupId>com.org.sqlserver</groupId>
<artifactId>sqljar</artifactId>
<version>1.4.2</version>
</dependency>
your can change the group id or artifact id or version depending on your wish
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With