Java SQL PreparedStatement addValuesToPreparedStatement(PreparedStatement preparedStatement, List values)

Here you can find the source of addValuesToPreparedStatement(PreparedStatement preparedStatement, List values)

Description

add Values To Prepared Statement

License

Open Source License

Declaration

public static void addValuesToPreparedStatement(PreparedStatement preparedStatement, List values)
            throws SQLException 

Method Source Code


//package com.java2s;
/*//from  w ww.  j a  v  a2s .com
 * Copyright 2000-2011 Enonic AS
 * http://www.enonic.com/license
 */

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

public class Main {
    public static void addValuesToPreparedStatement(PreparedStatement preparedStatement, List values)
            throws SQLException {
        int i = 1;
        for (Iterator iter = values.iterator(); iter.hasNext(); i++) {
            Object paramValue = iter.next();
            preparedStatement.setObject(i, paramValue);
        }
    }
}

Related

  1. addBatch(PreparedStatement prepStmt)
  2. close(PreparedStatement preparedStatement)
  3. close(PreparedStatement stat)
  4. closePreparedStatement(Map psMap)
  5. closePreparedStatement(PreparedStatement pstmt)