Class ArrayParameterHandler<T>

  extended by com.onewebsql.util.jdbc.ArrayParameterHandler<T>
Type Parameters:
T - type of objects in the array
All Implemented Interfaces:

public class ArrayParameterHandler<T>
extends Object
implements ParameterHandler<T[]>

Implementation of a ParameterHandler interface which binds objects in the specified array to consecutive parameters of the specified PreparedStatement. The argument of the method ParameterHandler.bindParameters(PreparedStatement, Object) should be an array of objects of type T (T[]). Consecutive elements of the array are bound to consecutive parameters of PreparedStatement, like in the following code:

 statement.setObject(1, parameters[0]);
 statement.setObject(2, parameters[1]);

Constructor Summary
          Creates a new ArrayParameterHandler object.
Method Summary
 void bindParameters(PreparedStatement preparedStatement, T[] parameters)
          Binds the specified parameters (using the methods set<Type>(int index, ...)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ArrayParameterHandler()
Creates a new ArrayParameterHandler object.

Method Detail


public void bindParameters(PreparedStatement preparedStatement,
                           T[] parameters)
                    throws SQLException
Description copied from interface: ParameterHandler
Binds the specified parameters (using the methods set<Type>(int index, ...)) to the specified PreparedStatement.

Specified by:
bindParameters in interface ParameterHandler<T[]>
preparedStatement - SQL statement
parameters - parameters to be bound
SQLException - if an error occurs while binding parameters

Copyright © 2011-2013 e-point SA. All Rights Reserved.