| java.lang.Object com.mockrunner.jdbc.ParameterUtil
ParameterUtil | public class ParameterUtil (Code) | | Util class for PreparedStatement and ResultSet
parameters.
|
Method Summary | |
public static boolean | compareParameter(Object source, Object target) Compares two parameters of a PreparedStatement or
CallableStatement . | public static Object | copyParameter(Object source) Copies a parameter of a PreparedStatement ,
CallableStatement or a ResultSet value.
InputStream objects, Reader objects
and arrays are copied into new allocated streams or arrays.
All other objects are cloned by calling the clone method. |
compareParameter | public static boolean compareParameter(Object source, Object target)(Code) | | Compares two parameters of a PreparedStatement or
CallableStatement . Can also be used to compare
values of a ResultSet . It is used by
com.mockrunner.jdbc.PreparedStatementResultSetHandler for comparing parameters specified in the prepare
methods.
Since the parameters can be of the type byte[] ,
InputStream and Reader this method handles
these types of objects. All other objects are compared using the
equals method. The mock versions of Ref ,
Array , Blob , Clob ,
Struct etc. all provide a suitable equals
implementation.
Parameters: source - the first parameter Parameters: target - the second parameter true if source is equal to target,false otherwise |
copyParameter | public static Object copyParameter(Object source)(Code) | | Copies a parameter of a PreparedStatement ,
CallableStatement or a ResultSet value.
InputStream objects, Reader objects
and arrays are copied into new allocated streams or arrays.
All other objects are cloned by calling the clone method.
If the object is not cloneable, it is returned unchanged.
Parameters: source - the parameter to copy a copy of the parameter |
|
|