Logo of Bento frameworkspaceObject Oriented Programming


Example Map4String interface for RequestStore


package com.bentofw.requeststore;

import java.sql.*;
import com.bentofw.util.*;

/**
 * Map4String implementation for String.
 *
 * @author Jun Inamori
 */
public class StringMap 
   implements Map4String{

    public byte[] columnToBytesInUtf8
                  (ResultSet rs,
                   int columnindex)
	throws NestedException{
	try{
	    return rs.getBytes(columnindex);
	}
	catch(Exception ex){
	    throw new NestedException(ex);
	}
    }

    public void javaToColumn
                (PreparedStatement st,
                 int columnindex,
                 Object value)
	throws NestedException{
	try{
	    st.setString(columnindex,(String)value);
	}
	catch(Exception ex){
	    throw new NestedException(ex);
	}
    }

} //End of : StringMap


Copyright © 1997-2007 OOP-Research CorporationTM, All Rights Reserved.