private OleBlob getBlob(Row row, String cName) { byte[] bytes = row.getBytes(cName); if (bytes == null) { return null; } return JackcessOleUtil.parseBlob(bytes); }
private OleBlob getBlob(Row row, String cName) { byte[] bytes = row.getBytes(cName); if (bytes == null) { return null; } return JackcessOleUtil.parseBlob(bytes); }
private byte[] getNewObjectOwner() throws IOException { if(_newObjOwner == null) { // there doesn't seem to be any obvious way to find the main "owner" of // an access db, but certain db objects seem to have the common db // owner. we attempt to grab the db properties object and use its // owner. Row msysDbRow = _tableFinder.getObjectRow( getDbParentId(), OBJECT_NAME_DB_PROPS, Collections.singleton(CAT_COL_OWNER)); byte[] owner = null; if(msysDbRow != null) { owner = msysDbRow.getBytes(CAT_COL_OWNER); } _newObjOwner = (((owner != null) && (owner.length > 0)) ? owner : SYS_DEFAULT_SID); } return _newObjOwner; }
/** * Find collection of SIDs for the given parent id. */ private void collectNewObjectSIDs(Integer parentId, List<byte[]> sids) throws IOException { // search for ACEs matching the given parentId. use the index on the // objectId column if found (should be there) Cursor cursor = createCursorWithOptionalIndex( getAccessControlEntries(), ACE_COL_OBJECT_ID, parentId); for(Row row : cursor) { Integer objId = row.getInt(ACE_COL_OBJECT_ID); if(parentId.equals(objId)) { sids.add(row.getBytes(ACE_COL_SID)); } } if(sids.isEmpty()) { // if all else fails, use the hard-coded default sids.add(SYS_DEFAULT_SID); } }
private PropertyMaps readProperties(int objectId, Row objectRow, PropertyMaps.Owner owner) throws IOException { byte[] propsBytes = null; RowIdImpl rowId = null; if(objectRow != null) { propsBytes = objectRow.getBytes(CAT_COL_PROPS); objectId = objectRow.getInt(CAT_COL_ID); rowId = (RowIdImpl)objectRow.getId(); } return getPropsHandler().read(propsBytes, objectId, rowId, owner); }
public Row(com.healthmarketscience.jackcess.Row tableRow) { this(tableRow.getId(), tableRow.getByte(COL_ATTRIBUTE), tableRow.getString(COL_EXPRESSION), tableRow.getShort(COL_FLAG), tableRow.getInt(COL_EXTRA), tableRow.getString(COL_NAME1), tableRow.getString(COL_NAME2), tableRow.getInt(COL_OBJECTID), tableRow.getBytes(COL_ORDER)); }