This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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: 331
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: 7500
    
  18

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?
Articles by Winston can be found here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: size of array
 
Similar Threads
How to add a merge array from 2 others arrays and print it
Removing duplicates from an ordered array
Three dim array
abhilash's quiz problems
Pleas help with array