Files
openide/java/java-impl/resources/inspectionDescriptions/ResultSetIndexZero.html
2025-02-05 04:43:28 +00:00

14 lines
523 B
HTML

<html>
<body>
Reports attempts to access column 0 of <code>java.sql.ResultSet</code> or <code>java.sql.PreparedStatement</code>.
For historical reasons, columns of <code>java.sql.ResultSet</code> and <code>java.sql.PreparedStatement</code>
are numbered starting with <b>1</b>, rather than with <b>0</b>, and accessing column 0 is a common error in JDBC programming.
<p><b>Example:</b></p>
<pre><code>
String getName(ResultSet rs) {
<b>return</b> rs.getString(0);
}
</code></pre>
<!-- tooltip end -->
</body>
</html>