Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using eclipse and maven 2, how to get dependancy for sqljdbc4?

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?

like image 273
Blankman Avatar asked Jan 19 '26 10:01

Blankman


2 Answers

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.

like image 73
Pascal Thivent Avatar answered Jan 22 '26 00:01

Pascal Thivent


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

like image 26
haripcce Avatar answered Jan 21 '26 22:01

haripcce