*/
protected SFSBBeanState getSFSBean(ResultSet rst) {
if(_logger.isLoggable(Level.FINER)) {
_logger.entering("HAEjbStore", "getSFSBean", rst);
}
SFSBBeanState bean = null;
String id = null;
byte[] beandata = null;
String clusterid = "";
long lastaccess = 0;
String containerId = null;
BufferedInputStream bis = null;
long longContId = 0;
try {
if(_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST, "HAEjbStore: getSFSBean ResultSet =" + rst);
}
id = rst.getString(1); //bean ID
Blob blob = rst.getBlob(2); //beandata
clusterid = rst.getString(3); //clusterid
lastaccess = rst.getLong(4); //lastaccess
containerId = rst.getString(5); //containerId
//FIXME later this should be long in database
longContId = (Long.valueOf(containerId)).longValue();
//beandata = blob.getBytes( (long) 1, (int) blob.length());
//replacing use of getBytes
int blobLen = (int) blob.length();
beandata = new byte[blobLen];
DataInputStream dis = new DataInputStream(blob.getBinaryStream());
try {
dis.readFully (beandata, 0, blobLen);
} catch (IOException ex) {
_logger.log(Level.FINE,
"HAEjbStore: getSFSBean error getting blob data");
}
if(_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST,
"HAEjbStore: SFSBBeanState id =" + id + " clusterid=" +
clusterid + " lastaccess=" + lastaccess +
" blob.length=" +
blob.length() + " beandata.length=" + beandata.length +
" containerId=" + containerId);
}
}
catch (SQLException sqe) {
sqe.printStackTrace();
}
//bean = new SFSBBeanState(id, lastaccess, false, beandata);
SFSBStoreManager mgr = this.manager;
bean = new SFSBBeanState(clusterid, longContId, id, lastaccess,
false, beandata, mgr);
if(_logger.isLoggable(Level.FINER)) {
_logger.exiting("HAEjbStore", "getSFSBean", bean);
}