I am getting " Invalid column index" in java based stored procedure
And yet you didn't actually post the EXACT exception that you are getting. The stack trace will tell you exactly what line number the exception occurs on.
And if you print out the index values that you are using you will see why you are getting that exception.
Don't be afraid of breaking Java by actually TRYING things.
Quit TELLING us what you THINK is happening and post the EXACT results of what IS happening.
You still haven't posted the EXACT exception and stack trace that you are getting.
And what you did post shows that 'startIndex' is NEVER being incremented since all printed values are '1'. The only way that can be based on what you just posted is in 'len' is ZERO. But since you never bothered to print 'len' we have NO idea what it's value is.
There are NO shortcuts. You have to trace through the code (e.g. using NetBeans) to see what is actually happening or print out variable values that show what is happening.