Code example for PreparedStatement

Methods: setDouble

0
	@Override 
	public void setParameter(PreparedStatement ps, int i, Object parameter,
			JdbcType jdbcType) throws SQLException {
		 
		double amount = ((MonetaryAmount)parameter).asDouble();
		ps.setDouble(i, amount);
	} 
 
	@Override 
	public Object getResult(ResultSet rs, String columnName)
			throws SQLException { 
		 
        double amount = rs.getDouble(columnName);
        return new MonetaryAmount(amount);
	} 
 
	@Override 
	public Object getResult(CallableStatement cs, int columnIndex)
			throws SQLException { 
		double amount = cs.getDouble(columnIndex);
        return new MonetaryAmount(amount);