This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Here we go... Java Env:WSAD 5.0 Local OS:Windows 2000 Pro DB:Oracle 9i (9.2.0.1) DB OS:Solaris 8.0(I think)
I am using a PreparedStatement.addBatch(), to do multiple database updates. In my first attempt I tried to use Replacable Parameters to set my values into the statement. This worked with 1 or more records, however, the int array that PreparedStatement.executeBatch() return contains nothing but -2's. Now, I know that -2 means "Successful, but updated number of records is unknown". But it would be nice to make sure the number of updated are what I think they should be. After seeing all of the -2's returned I modified my method to "build" the sql statements by using a StringBuffer. I then used Statement.addBatch(sqlString). This time the array returned all 1's which is what I wanted. My question is, does anyone know why PreparedStatement.executeBatch() returns -2's and Statement.executeBatch returns 1's while running the same queries? Here is a snippet of my code the large block of commented out code is from my second attempt. I am including it for posterity. At the bottom recordCount is an int[].
Thanks in advance. [ May 22, 2003: Message edited by: Heath Lilley ]
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.