码迷,mamicode.com
首页 > 其他好文 > 详细

ANT 测试

时间:2016-11-21 19:57:14      阅读:283      评论:0      收藏:0      [点我收藏+]

标签:date   bin   user   sql   cte   connector   classpath   amp   handle   

 

 

--JDK HOME
C:\Program Files\Java\jdk1.7.0_79

--ANT HOME
D:\10\11\1121\apache-ant-1.9.7-bin

 

--file :sqlsample.xml

<?xml version="1.0" encoding="UTF-8"?>
<project name="DBHandler" basedir="." default="ConnectOracle">
<property name="oracleDriver" value="oracle.jdbc.driver.OracleDriver"/>
<property name="oracleJar" location="C:\app\hupeng\product\11.2.0\client_1\jdbc\lib\ojdbc6.jar" />
<property name="oracleUrl" value="jdbc:oracle:thin:@10.182.190.119:1521:UCM"/>
<property name="oracleUser" value="peng" />
<property name="oraclePassword" value="peng" />
<property name="oracleFile" value="oracle.sql" />

<target name="ConnectOracle">
<sql driver="${oracleDriver}"
url="${oracleUrl}"
userid="${oracleUser}"
password="${oraclePassword}"
classpath="${oracleJar}"
print="true">
<!--select * from t_role where role_wid= ‘Everyone‘;-->
<transaction src="${oracleFile}"/>
</sql>
</target>
</project>

--file oracle.sql
select sysdate from dual;

-- excute:
ant -f sqlsample.xml
D:\10\11\1121\oracle>ant -f sample.xml
Buildfile: D:\10\11\1121\oracle\sample.xml

ConnectOracle:
[sql] Executing resource: D:\10\11\1121\oracle\oracle.sql
[sql] SYSDATE
[sql] 2016-11-21 18:07:25
[sql]
[sql] 0 rows affected
[sql] 1 of 1 SQL statements executed successfully

BUILD SUCCESSFUL
Total time: 7 seconds

 

ANT 测试

标签:date   bin   user   sql   cte   connector   classpath   amp   handle   

原文地址:http://www.cnblogs.com/feiyun8616/p/6086328.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!