I want to run an SQL query using the ant tasks, and I am using the SQLServerDriver (sqljdbc.jar). This jar file is located where I have all of my jars needed to run the application
(WebContent/WEB-INF/lib)
This directory is my classpath which I defined it in another TASK Command:
<!-- Define el classpath que es utilizado para compilar los archivos -->
<path id="classpath">
<fileset dir="${libs.dir}">
<include name="*.jar" />
</fileset>
</path>
This jar file is also indicated in my ecplise external jar files.
The ant command that I am trying to run is the following:
<target name="db.query" description="Ejecuta un query de SQL">
<sql driver="${db.driverT}" url="${db.urlT}" userid="${db.userT}"
password="${db.passwordT}" print="TRUE">
SELECT * FROM T007_EDO;
</sql>
</target>
What should I do to correct my error?
The answer to this question was to simply add the line to my db.query task.
So I have my classpath deffinition of the place where the jar file is located in:
And I reference that in my ant task: