java.sql.ResultSet
or java.sql.PreparedStatement
.
For historical reasons, columns of java.sql.ResultSet
and java.sql.PreparedStatement
are numbered starting with 1, rather than with 0, and accessing column 0 is a common error in JDBC programming.
Example:
String getName(ResultSet rs) {
return rs.getString(0);
}