ANT:JDBC驱动程序错误 [英] ANT: Jdbc driver error

查看:318
本文介绍了ANT:JDBC驱动程序错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试以下code:

 <sql
    classpath="postgresql-8.4-701.jdbc3.jar"
    driver="org.database.jdbcDriver"
    url="devtest"
    userid="uid"
    password="pass">

select * from tab where tname = 'GR_DOCUMENT_PRINT_DFV';

 </sql>

提示以下错误:

BUILD FAILED
C:\Program Files\Java\apache-ant-1.8.1\build.xml:62: Class Not Found: JDBC driver
org.database.jdbcDriver could not be loaded

Total time: 1 second

请帮忙。

现在我已经更新了code。添加类路径到previous code。还添加MySQL连接器,Java的3.0.8稳定-bin.jar和PostgreSQL,8.4-701.jdbc3.jar文件ANT_HOME / lib下,但仍然得到同样的错误。

Now I have updated the code. Add classpath to the previous code. Also add mysql-connector-java-3.0.8-stable-bin.jar and postgresql-8.4-701.jdbc3.jar file to ANT_HOME/lib but still getting the same error.

推荐答案

如果您正在使用Oracle,你可以尝试

If you're using Oracle, can you try

<path id="antclasspath"> 
    <fileset dir="path-to-lib"> 
        <include name="ojdbc14.jar"/> 
    </fileset> 
</path> 


<sql 
    driver="oracle.jdbc.driver.OracleDriver" 
    url="jdbc:oracle:thin:@serverip:1521:sid" 
    userid="userid" 
    password="password" 
    print="yes" 
    classpathref="antclasspath"> 
    select * from tab where tname = 'GR_DOCUMENT_PRINT_DFV'; 
</sql> 

如果你仍然有同样的错误,与-v开关运行的蚂蚁。这将直接SQL任务打印出它使用的类路径,并可以验证。

If you still have the same error, run ant with the -v switch. That will direct the sql task to print out the classpath it's using and you can verify.

这篇关于ANT:JDBC驱动程序错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆