Here you can find the source of setValues(PreparedStatement statement, Object... values)
Parameter | Description |
---|---|
statement | a parameter |
values | The parameter values to be set in the created PreparedStatement. |
Parameter | Description |
---|---|
SQLException | If something fails during setting thePreparedStatement values. |
public static void setValues(PreparedStatement statement, Object... values) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.PreparedStatement; import java.sql.SQLException; public class Main { /**/*from w w w . ja va2s .co m*/ * Set the given parameter values in the given PreparedStatement. * * @param statement * @param values The parameter values to be set in the created * PreparedStatement. * @throws SQLException If something fails during setting the * PreparedStatement values. */ public static void setValues(PreparedStatement statement, Object... values) throws SQLException { for (int i = 0; i < values.length; i++) { statement.setObject(i + 1, values[i]); } } }