All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.yawp.driver.postgresql.sql.PlaceHolder Maven / Gradle / Ivy

There is a newer version: 2.08alpha
Show newest version
package io.yawp.driver.postgresql.sql;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class PlaceHolder {

    private List indexes = new ArrayList();

    private Object value;

    public PlaceHolder(Object value) {
        this.value = value;
    }

    public void addIndex(int index) {
        indexes.add(index);
    }

    public void setValue(PreparedStatement ps) {
        try {
            for (int index : indexes) {
                ps.setObject(index, value);
            }
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy