package com.bentofw.requeststore;
import java.sql.*;
import com.bentofw.util.*;
/**
* Map4String implementation for Integer.
*
* @author Jun Inamori
*/
public class IntegerMap
implements Map4String{
public byte[] columnToBytesInUtf8
(ResultSet rs,
int columnindex)
throws NestedException{
try{
return (Integer.
toString(rs.getInt(columnindex))).
getBytes("UTF-8");
}
catch(Exception ex){
throw new NestedException(ex);
}
}
public void javaToColumn
(PreparedStatement st,
int columnindex,
Object value)
throws NestedException{
if(value instanceof java.lang.String){
try{
st.setInt(columnindex,
Integer.parseInt((String)value)
);
}
catch(Exception ex){
throw new NestedException(ex);
}
}
else{
try{
st.setInt(columnindex,
((Integer)value).intValue()
);
}
catch(Exception ex){
throw new NestedException(ex);
}
}
}
} //End of : IntegerMap
|
Copyright © 1997-2007 OOP-Research CorporationTM, All Rights Reserved.