It's not a secret anymore!
The moose likes Java in General and the fly likes size of array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "size of array" Watch "size of array" New topic

size of array

Isaac Ferguson
Ranch Hand

Joined: Jun 22, 2012
Posts: 594

I have the next code

then filePerson.length() has a size of 3 (lines in a file) and listId.size() has a size of 2.

then when I compare the j is 3 but the array is 2. I get the excep

What I need to do is if a value which cames from the file it is not in the array then insert it to the DB

But when it read the third value from the file which it is not in the array which contains all the values which already are in the DB it fails

Any advice, please?

Winston Gutkowski

Joined: Mar 17, 2011
Posts: 8661

Angus Ferguson wrote:Any advice, please?

Yes, DontWriteLongLines (←click).
It makes your thread very hard to read, which is likely to put people off from responding. I'd correct it myself, but there's quite a lot to be done.
Use the 'Edit' button and break that "SELECT" String up and cool your indenting a bit. You'll be amazed how much easier it is to read.



Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
I agree. Here's the link:
subject: size of array
It's not a secret anymore!