The Artima Developer Community
Sponsored Link

Java Buzz Forum
How to fix java.sql.SQLException: Invalid column index

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javin Paul

Posts: 1090
Nickname: javinpaul
Registered: Jan, 2012

Javin Paul is Java Programmer working on Finance domain.
How to fix java.sql.SQLException: Invalid column index Posted: Jan 25, 2012 8:51 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Javin Paul.
Original Post: How to fix java.sql.SQLException: Invalid column index
Feed Title: Javarevisited Blog
Feed URL: http://javarevisited.blogspot.com/feeds/posts/default?alt=rss
Feed Description: Blog on Java, Unix, Linux, FIX Protocol technology. I share my experience as tutorial, article, interview questions, programming, design etc.
Latest Java Buzz Posts
Latest Java Buzz Posts by Javin Paul
Latest Posts From Javarevisited Blog

Advertisement


java.sql.SQLException: Invalid column index

"java.sql.SQLException: Invalid column index" is a frequent error while working in Java Database Connectivity (JDBC). As the name suggests "Invalid column index" its related to accessing or setting column in your SQL Query using prepared statement in Java. I have seen "java.sql.SQLException: Invalid column index" coming mostly due to two reason:

1) Setting column data using setXXXX(int coloumIndex) e.g. setInt(0) setString(0)
2) Getting column data using getXXX(int columnIndex) e.g. getInt(0) getString(0)

Most common cause of "java.sql.SQLException: Invalid column index" is misconception that column index started with "0" like array or String index but that's not true instead column index starts with "1" so whenever you try to get or Set column data with column index "0" you will get "java.sql.SQLException: Invalid column index".
Read more ยป

Read: How to fix java.sql.SQLException: Invalid column index

Topic: Tips for Testing Database Code Previous Topic   Next Topic Topic: Maven Tutorial 01 - Introduction and Setting up

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use