001package org.itsallcode.jdbc; 002 003import java.sql.PreparedStatement; 004import java.sql.SQLException; 005 006/** 007 * Instances of this class allow setting values for a {@link PreparedStatement}. 008 */ 009@FunctionalInterface 010public interface PreparedStatementSetter { 011 /** 012 * Set values for the given prepared statement. 013 * <p> 014 * Only call {@link PreparedStatement#setObject(int, Object)} or similar 015 * methods. Do not call {@link PreparedStatement#addBatch()}. 016 * 017 * @param preparedStatement prepared statement 018 * @throws SQLException if setting values fails 019 */ 020 void setValues(PreparedStatement preparedStatement) throws SQLException; 021}