Code example for PreparedStatement

Methods: setNull, setString

0
		if (cell instanceof SimpleCell && type instanceof SimpleTypeDateTime) {
			SimpleCell simple = (SimpleCell) cell;
			String data = simple.getSimpledata();
			try { 
				if (data != null) {
					ps.setString(index, data);
				} else { 
					ps.setNull(index, Types.CHAR);
				} 
			} catch (SQLException e) {
				throw new ModuleException("SQL error while handling cell " 
						+ cell.getId(), e);
			} 
 
		} else { 
			super.handleDataCell(ps, index, cell, type);
		} 
		return ret;
	} 
}