This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "size of array" Watch "size of array" New topic
Author

size of array

Isaac Ferguson
Ranch Hand

Joined: Jun 22, 2012
Posts: 321
Hi

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?

Thanks
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7032
    
  16

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.

Thanks.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Artlicles by Winston can be found here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: size of array
 
Similar Threads
abhilash's quiz problems
Three dim array
Removing duplicates from an ordered array
Pleas help with array
How to add a merge array from 2 others arrays and print it