oracle的表通过.xls导入到mysql,把表当附件发邮件小例

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/DHeartLi/article/details/79972460
1.先连接oracle ds,操作表
2.对oracle进行数据操作
3.导出表数据
4.把表信息导入mysql
5.在配置SMTP
6.。。。。
<ds id="mysql_ds"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3308/xml?useUnicode=true&amp;characterEncoding=utf8"
userid="xxxx"
password="123456"
/>
<ds id="orcl_ds"
url="jdbc:oracle:thin:@localhost:1521:orcl"
driver="oracle.jdbc.driver.OracleDriver"
userId="xxxx"
password="123456"
rdbms="oracle"
/>
<sqlexec datasource="orcl_ds" hidestatinfo="false" autocommit="true" onerror="continue" export="data.xls">
insert into aa values(8,2);
<![CDATA[
select * from aa;
]]>
</sqlexec>
<sqlexec datasource="mysql_ds" hidestatinfo="false" autocommit="true" onerror="continue" import="data.xls" startrow="2">
insert into user(username,password) values(:1,:2);
</sqlexec>
<var name="message" value="aaaaa &lt;/table&gt;"/>
<mail mailhost="smtp.qq.com" mailport="465" user="83522@qq.com" password="不是密码,是授权码" subject="Results of nightly build" ssl="true" messagemimetype="text/html">
<from address="3522@qq.com"/>
<to address="223671@qq.com"/>
<message>${message}</message>
<attachments>
<fileset dir="." erroronmissingdir="false">
<include name="data.xls"/>
</fileset>
</attachments>
</mail>


阅读更多
换一批

没有更多推荐了,返回首页