Find invalid JDBC indices

Proprietary

Finds PreparedStatement.set...(int, ...) and ResultSet.get...(int, ...) calls whose first argument is invalid: the literal 0 (both APIs are 1-based); for PreparedStatement, an index that exceeds the number of ? placeholders in the SQL passed to Connection.prepareStatement(...) / prepareCall(...); or a for-loop counter declared starting at 0, which is a common off-by-one against JDBC's 1-based indexing. Each mistake throws SQLException at runtime.

org.openrewrite.java.security.search.FindInvalidJdbcIndex
mod run . --recipe=org.openrewrite.java.security.search.FindInvalidJdbcIndex

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.