简体   繁体   English

从Java中的msaccess数据库检索图像

[英]Retrieve image from msaccess database in java

I have Stores an Image in Ms access Database and datatype of column is OLE OBJECT. 我在MS Access数据库中存储了一个图像,列的数据类型是OLE OBJECT。 But i am Unable to retrieve the Image from database. 但是我无法从数据库中检索图像。 Please help.. 请帮忙..

When i try to Open Image its show Error 当我尝试打开图像时,显示错误

Unknown File Format or file not found. 未知文件格式或找不到文件。

First thing we need to do is set the column type as OLE Object . 我们需要做的第一件事是将列类型设置为OLE Object While saving the data into the column of type OLE Object , save the data as byte array , while retrieving the image from the column read the value, put the value into byte array and then convert the byte array to image type and display the same. 将数据保存到OLE Object类型的列中时,将数据另存为byte array ,同时从列中检索图像时,读取值,将值放入byte array ,然后将byte array转换为image type并显示相同的值。 This is very simple. 这很简单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM