Java Mailing List Archive

http://www.ant-tasks.com/

Home » Ant Users List »

答复: how to load a bunch data from a txt file, and ant sql call these data

Chaohua Wang

2008-03-19

Replies:

I am not interested in your link. I don't ask people for doing homework for me.
I am asking for hint and some helpful links.
Pleas understand my question first.


-----Original Message-----
From: Anderson, Rob (Global Trade) [mailto:Rob.Anderson@(protected)]
Sent: 2008-3-19 (星期三) 18:56
To: Ant Users List
Subject: RE: how to load a bunch data from a txt file, and ant sql call these data

I'm not trying to be a jerk, but you would probably benefit from reading
the following...

http://catb.org/~esr/faqs/smart-questions.html

I don't think anybody here is interested in doing your work for you. But
if you have specific questions about things you are having difficulty
with, we are happy to help if we can.

-Rob Anderson


-----Original Message-----
From: Chaohua Wang [mailto:cwang@(protected)]
Sent: Wednesday, March 19, 2008 3:52 PM
To: Ant Users List
Cc: floess@(protected)
Subject: how to load a bunch data from a txt file, and ant sql call
these data

Hi Folks,

I have a ant sql statement


<target name="insertData">
   <sql driver="${jdbcdriver}" url="${dburl}/BillPay"
userid="${userid}" password="${password}"
     print="yes" onerror="continue"
output="${tmp.dir}/dbModification.txt">
     <transaction> INSERT INTO Payment (RefNumber,
VAN, Amount, OptCode, VendorID,
       PriorRefNumber, TransactionTS,
IsProcessed) VALUES
 
('6569998989','2131213','1131',2031,232,'7898', { fn NOW() },1);
</transaction>
     <transaction> INSERT INTO Payment (RefNumber,
VAN, Amount, OptCode, VendorID,
       PriorRefNumber, TransactionTS,
IsProcessed) VALUES
 
('9565689232323','21313213','1131',2031,232,'7898', { fn NOW() },1);
</transaction>
   </sql>

Here there are 2 sql statement to insert. But I have more than 100 data
put in txt file.

Like this
'1569998989','2131213','1131',2031,232,'7898', { fn NOW() },
'2569998989','2131213','1131',2031,232,'7898', { fn NOW() },
'3569998989','2131213','1131',2031,232,'7898', { fn NOW() },


Could you tell me How can load these data from a txt file. And using
loop to insert these data into database. Which means dynamically.
So I don't need to put more thant 100 sql statement in the ant build
file.

Thank you very much.

Cwang



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.