1 22 package org.jboss.test.cmp2.jbas3541; 23 24 import java.sql.PreparedStatement ; 25 import java.sql.SQLException ; 26 import java.sql.ResultSet ; 27 import org.jboss.ejb.plugins.cmp.jdbc.JDBCParameterSetter; 28 import org.jboss.ejb.plugins.cmp.jdbc.JDBCResultSetReader; 29 import org.jboss.logging.Logger; 30 31 35 public class IntJDBCAdaptor 36 implements JDBCParameterSetter, JDBCResultSetReader 37 { 38 public void set(PreparedStatement ps, int index, int jdbcType, Object value, Logger log) throws SQLException 39 { 40 if(value == null) 41 { 42 ps.setNull(index, jdbcType); 43 } 44 else 45 { 46 ps.setInt(index, 2); 47 } 48 } 49 50 public Object get(ResultSet rs, int index, Class destination, Logger log) throws SQLException 51 { 52 return rs.wasNull() ? null : new Integer (rs.getInt(index)); 53 } 54 } 55 | Popular Tags |