Hi,
I have created a Java program which I call each night at approximately
7PM whereby I pick up all files residing in a local directory in a
pre-defined format. The format is basically part,quantity with the
file name being [id].txt.
From this, I create two PreparedStatements.
1 - INSERT INTO
([id], [part], [quantity])
AND
2 - UPDATE
SET QUANTITY = ? WHERE ID = [id] and PART = part
The file contains approximately 110000 lines and it is assumed that
the file is a full file. I loop through the file calling the
PreparedStatement(2) and update each part with the new quantity. If I
hit an error whereby the part does not exist, I insert the part and
quantity via PreparedStatement(1).
The problem I have is that this program generally takes 8-9 hours to
complete which is quite long. We are looking to expand it to update
many files but at this rate we will have to wait weeks to complete all
files!!!
The format of the file can not be changed as it is sent to use from
another company and they have defined the format.
Is there a quicker better way??????
Please help, I'm at a loss to figure out how to speed this up.
Shannon
I have created a Java program which I call each night at approximately
7PM whereby I pick up all files residing in a local directory in a
pre-defined format. The format is basically part,quantity with the
file name being [id].txt.
From this, I create two PreparedStatements.
1 - INSERT INTO
AND
2 - UPDATE
The file contains approximately 110000 lines and it is assumed that
the file is a full file. I loop through the file calling the
PreparedStatement(2) and update each part with the new quantity. If I
hit an error whereby the part does not exist, I insert the part and
quantity via PreparedStatement(1).
The problem I have is that this program generally takes 8-9 hours to
complete which is quite long. We are looking to expand it to update
many files but at this rate we will have to wait weeks to complete all
files!!!
The format of the file can not be changed as it is sent to use from
another company and they have defined the format.
Is there a quicker better way??????
Please help, I'm at a loss to figure out how to speed this up.
Shannon