This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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: 649

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: 8837

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.



Bats fly at night, 'cause they aren't we. And if we tried, we'd hit a tree -- Ogden Nash (or should've been).
Articles by Winston can be found here
I agree. Here's the link:
subject: size of array
It's not a secret anymore!