Inside a loop I am setting the input parameters of prepared statement to be inserted ane suppose it fails due to a rason that input value is too large for a colmn for some record in an iteration i. Since i already has reached the threshold value when I am executing a batch so I seem to have lost which culprit record at which iteration caused it PreparedStatement doesn't seem to have any clue on finding this Does any one of you have faced similar situation and know of any crack ?
Thanks in advance
SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
It might help if you can give code snippet. It's not clear what you were doing with the description. Anyway - Is the loop used to construct the statement and added to a batch to be executed through executeBatch()? If not what do you meant by crossed the threshold?
I am sort of confused... a crack for what? A crack is a program or process that makes crippled software into fully functioning software, so I don't see how that pertains to your situation.(At least that's what I always thought it meant).
You could do several different things. One, you could check the data for size before it gets inserted into the prepared statement. Or you could dump your data into a comma delimited file and insert the data from the sql command line.
Joined: Jun 09, 2000
I am using executeBatch and by threshold I meant the size of collection (which I am passing ott his function) I get the input paremeters from the dataObject of this collection and set them as setters of preparedstatement which I have created before loop
Code snippet is very huge but this is what I am doing (In a nutshell)
Joined: May 24, 2003
If you look at the executeBatch() api description, the return type is int array with the status code of the each statement executed (the order in which it's added to the batch). It should be fairly easy to identify the statement that failed (unless the driver you use doesn't support this feature).
Take a look at the executeBatch() api description let us know if it doesn't work.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Is there a way of knowing which record failed in Batch Insert