在1.2以前的版本中没有考虑到对BLOB的优化,如果一个表中含有BLOB字段,IDBAccesser.GetObjects方法返回的对象中将会直接把Blob读到对应的字段中,这可以通过IDBAccesser的基接口IDBAccesserQuery看出来:
publicinterfaceIDBAccesserQuery


{
bool ReviseAObject(stringwhere_str,objecttarget);//使用数据库内容来更新当前对象
object GetAObject(stringwhere_str);//ifthereisnoconditionclause,pleaseinput""
object[] GetObjects(stringwhere_str);
DataSetGetDataSet(stringselect_str);
}
在1.3版本中IDBAccesserQuery接口增强如下:
publicinterfaceIDBAccesserQuery


{
bool ReviseAObject(stringwhere_str,objecttarget);//使用数据库内容来更新当前对象
object GetAObject(stringwhere_str);//ifthereisnoconditionclause,pleaseinput""
object[] GetObjects(stringwhere_str);
object[] GetObjectsWithoutBlob(stringwhere_str);//获取的对象中凡是Blob字段都未填充
bool FillBlobData(objectobj);//填充某个对象的所有Blob字段
DataSet GetDataSet(stringselect_str);
}
通过调用IDBAccesser.GetObjectsWithoutBlob()方法可以在从数据库中读取对象的时候先不加载BLOB字段,只有在必要的时候才调用IDBAccesser.FillBlobData()方法来填充某对象的BLOB字段。
这样即兼顾了效率,又不失灵活性。
想使用1.3版本的朋友,请留下email。
publicinterfaceIDBAccesserQuery

{
bool ReviseAObject(stringwhere_str,objecttarget);//使用数据库内容来更新当前对象
object GetAObject(stringwhere_str);//ifthereisnoconditionclause,pleaseinput""
object[] GetObjects(stringwhere_str);
DataSetGetDataSet(stringselect_str);
}
在1.3版本中IDBAccesserQuery接口增强如下:
publicinterfaceIDBAccesserQuery

{
bool ReviseAObject(stringwhere_str,objecttarget);//使用数据库内容来更新当前对象
object GetAObject(stringwhere_str);//ifthereisnoconditionclause,pleaseinput""
object[] GetObjects(stringwhere_str);
object[] GetObjectsWithoutBlob(stringwhere_str);//获取的对象中凡是Blob字段都未填充
bool FillBlobData(objectobj);//填充某个对象的所有Blob字段
DataSet GetDataSet(stringselect_str);
}
通过调用IDBAccesser.GetObjectsWithoutBlob()方法可以在从数据库中读取对象的时候先不加载BLOB字段,只有在必要的时候才调用IDBAccesser.FillBlobData()方法来填充某对象的BLOB字段。
这样即兼顾了效率,又不失灵活性。
想使用1.3版本的朋友,请留下email。
博客介绍了数据库不同版本对BLOB字段处理的差异。1.2以前版本未对BLOB优化,GetObjects方法会直接读取Blob到字段。1.3版本增强了IDBAccesserQuery接口,新增GetObjectsWithoutBlob和FillBlobData方法,可先不加载BLOB字段,必要时再填充,兼顾效率与灵活性。
7355

被折叠的 条评论
为什么被折叠?



