Search This Blog

Total Pageviews

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)

No comments:

How to generate Digital Certificate?

keytool -genkey -v -keystore c:\Users\<user>\key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key