Above is my code.....Suggest me appropriate variable names for i,j,k?
Always use code tags for your code. That makes it much easier to go through it. I don't think anyone would bear the pain of going through your code until you useCodeTags. So, do it first
Suggest me appropriate variable names for i,j,k?
The name you give to a variable should accurately describe its purpose eg if it holds the number of guests in a hotel use something numGuests or guestCount etc.
Many years ago someone far wiser than me told me if you can't think of a good descriptive name for your class, method or variable then stop coding immediately because you clearly don't fully understand the problem.
So basically what I'm saying is you should already know what these variables should be called, so what do they do?
You seem to try to write clean code, so I would recommend you also be consistent with code formatting. Choose one style for your code, and try not to change it throughout the code.
Amruta Jegarkal wrote:j is a variable name used in loop so it doesn't matter for it.But k is holding a return value so what name i must give to that and even i is an array which holds return value of executeBacth()?So what kind of name i must use.
As Tony said, use a name that describes its use (or contents). In the case of executeBatch(), it returns an update count, so why not call it:
int updateCounts = preparedStatement.executeBatch();
int batchResults = preparedStatement.executeBatch();