Why do you call the updateQuery.next() inside the loop?
You call it at the end of the loop and at the beginning. So you are missing a row each time you loop.
Also you get that exception there because the array name is null.
Delete what you have. Don't use that many arrays. Create a single object with attributes the name, manufacturer, description,... and add get/set methods.
Then have an array of that object.
class Product {
String name=null;
...
double price=0;
// constructor
// get/set methods
}
But in this case you shouldn't use arrays because you don't know the size. You don't know how many elements you will get.
Use ArrayLists:
ArrayList list = new ArrayList();
list.add( /*the instance of your object*/ );
Product prod = (Product)list.get(i);
Put that code in a method that returns that ArrayList and close the ResultSet, PreparedStatement and Connection.
javaAddict
Nearly a Senior Poster
3,338 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 450
Skill Endorsements: 7