简体   繁体   中英

Reading a Java BLOB object stored a database using .NET

I have an xml file which is stored in an "image" column in an MSSQL database. This field is being set by a java program i do not have access to. I have been told its just a standard Java "blob" object.

Is there anyway for me to read this field from the db in .NET and decode it into a readable string?

I have close to no Java knowledge but signigicant .NET knowledge if that helps.

Thanks

There seems to be a workable example for reading the blob as bytes here:

https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-5766889.html

As far as a "standard Java "blob" object", that sounds like a mythical beast, unless he means a Java object serialized into a blob field. You could probably look into the spec for Java serialization and figure it out, but meantime it sounds to me like you've been given a standard Java object task by a standard glib manager.

Come to think of it here's a pretty neat suggestion. See the comment by the fellow regarding deserializing Java objects into .NET:

Deserialize in a different language

It should just be a byte[] . Have you tried reading it as such?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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