com.ibatis.sqlmap.engine.type

Interface TypeHandler

public interface TypeHandler

Interface for getting data into, and out of a mapped statement
Method Summary
booleanequals(Object object, String string)
Compares two values (that this handler deals with) for equality
ObjectgetResult(ResultSet rs, String columnName)
Gets a column from a result set
ObjectgetResult(ResultSet rs, int columnIndex)
Gets a column from a result set
ObjectgetResult(CallableStatement cs, int columnIndex)
Gets a column from a callable statement
voidsetParameter(PreparedStatement ps, int i, Object parameter, String jdbcType)
Sets a parameter on a prepared statement
ObjectvalueOf(String s)
Converts the String to the type that this handler deals with

Method Detail

equals

public boolean equals(Object object, String string)
Compares two values (that this handler deals with) for equality

Parameters: object - one of the objects string - the other object as a String

Returns: - true if they are equal

getResult

public Object getResult(ResultSet rs, String columnName)
Gets a column from a result set

Parameters: rs - the result set columnName - the column name to get

Returns: - the column value

Throws: SQLException if getting the value fails

getResult

public Object getResult(ResultSet rs, int columnIndex)
Gets a column from a result set

Parameters: rs - the result set columnIndex - the column to get (by index)

Returns: - the column value

Throws: SQLException if getting the value fails

getResult

public Object getResult(CallableStatement cs, int columnIndex)
Gets a column from a callable statement

Parameters: cs - the statement columnIndex - the column to get (by index)

Returns: - the column value

Throws: SQLException if getting the value fails

setParameter

public void setParameter(PreparedStatement ps, int i, Object parameter, String jdbcType)
Sets a parameter on a prepared statement

Parameters: ps - the prepared statement i - the parameter index parameter - the parameter value jdbcType - the JDBC type of the parameter

Throws: SQLException if setting the parameter fails

valueOf

public Object valueOf(String s)
Converts the String to the type that this handler deals with

Parameters: s - the String value

Returns: - the converted value

Copyright © 2011. All Rights Reserved.