Java SQL PreparedStatement setValues(PreparedStatement statement, Object... values)

Here you can find the source of setValues(PreparedStatement statement, Object... values)

Description

set Values

License

Open Source License

Declaration

public static boolean setValues(PreparedStatement statement, Object... values) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.PreparedStatement;

import java.sql.SQLException;

public class Main {
    public static boolean setValues(PreparedStatement statement, Object... values) {
        if (values != null) {
            for (int i = 0; i < values.length; ++i) {
                try {
                    statement.setObject(i, values[i]);
                } catch (SQLException e) {
                    return false;
                }/*from  w  ww  .  j  a v a2 s .c  o m*/
            }
        }
        return true;
    }
}

Related

  1. setValue(PreparedStatement ps, int paramIndex, Object inValue)
  2. setValue(PreparedStatement ps, int posicion, int tipo, String strDefault, String strValor)
  3. setValueIndex(PreparedStatement stmt, int index, int valueIndex)
  4. setValues(PreparedStatement preparedStatement, Object... values)
  5. setValues(PreparedStatement statement, Object... values)
  6. setValues(PreparedStatement statement, Object[] values)
  7. substitute(PreparedStatement stmt, Object[] params)
  8. writeArray(Connection connection, PreparedStatement preparedStatement, int column, Class type, T[] array)
  9. writeList(Connection connection, PreparedStatement preparedStatement, int column, Class type, List list)