How to install jTDS?
In the FAQ is written: "Just drop the jar file into your application's classpath"开发者_C百科;
What that means?
Im using Eclipse
It means exactly what it says. The classpath for a Java application is a list of directories and jar files that the classloader will use to find the classes you're using. You just need to make sure that the jtds jar file is in your classpath. Quite how you do this will depend on your application type. To run an app directly from Eclipse, you can just edit your project's build path to include the jar file... but if your app is running as a servlet within Tomcat (or something similar) the steps will be different.
If you're new to Java, I'd strongly recommend that you learn the basics (including the classpath) before you start doing any JDBC work.
If you are using command line:
java -cp jtds.jar:yourapplication.jar com.example.Main
If you are using Eclipse: How to Add JARs to Project Build Paths in Eclipse (Java).
If you are using Maven, add this to your pom.xml
:
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>1.2</version>
</dependency>
And change the title, the library is called jTDS.
You need to put .jar file in two places:
First one is folder "libs" which contains external libraries. Second place is your classpath, where you load .jar file from folder "libs".
Hope this works!
精彩评论