Sounds like you are on the right track.  You can store it in an array before
passing it on to the db.  I am not sure on the classes you would need, but
it sounds right.  I like the procedural way myself ;-)

Eric 

-----Original Message-----
From: loathe [mailto:[EMAIL PROTECTED] 
Sent: Monday, 14 August 2006 15:17
To: CF-Talk
Subject: Java/CF Question

I have a need to parse in a data file weekly.

The file is about 2200 lines long and is in a fixed width format.

It will be written to a DB2 database on a mainframe.

I'm thinking that I should create a java object that will do the heavy
lifting, only using CF as needed for the interface side of things, and to
return some bad data information (there is some validation against existing
data that needs to occur as the file is parsed into memory.

1.  Ok, I know about createObject(), and how it works, is there anything I
need in a class file in order for it to talk properly to CF?  Anything I
would want to have?  I know I'm using the FileInputStream class, and
getRow() and blah blah, is this the correct way of doing this?

2.  How do I pass a file from CF to Java?  I was thinking the easiest way
would be just have CF upload it, pass the path and file info to the object
and then have the class parse it, write it to the db, and return an array of
the bad rows.

3.  What are the best practices for an object like this?  Should I create
one method that reads in the file, one to get the row, a method to get and
set each member of the row?  Or should I just do it top to bottom procedural
style, read in the file, loop through the rows, stick each "column" in an
array, then grab them as needed, and so forth?

Any pointers from people that have done this before, or to some online info
about a similar practice would be much appreciated.
--
Thanks,





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:249885
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to