Umesh Vajpai wrote:Would be great help if someone can provide me sample code to write arrayList of ArrayList to any database.
Well, first of all, this site is
NotACodeMill. Second, you could do yourself a lot of favours by reading the
UseCodeTags page.
The reason for both exceptions is very simple:
1. IndexOutOfBoundsException is produced when you are trying to access an element that doesn't exist in your ArrayList; and I can certainly see why that might be - the "record" that you're returning almost certainly has fewer elements than your '
ObjectApiNames' array. What I suggest you do is to print out what you're getting from your '
get()' statement.
2. NullPointerException is produced because
something is null. Since I have no idea what
binding.create() does, it would be useless to speculate why, but you could try printing out the contents of '
s' immediately before you call it. Also, reading the API documentation for that method might tell you if/when it throws an NPE.
Winston