I'm translating some code written in C# to Java. This code uses COM objects to interact with a third party application. I managed to handle COM objects using com4j library, but one of the methods requires System.DBNull.value
to be passed into it which is a C# object.
How can I handle it from a Java application?
.NET System.DBNull
is equivalent to a VARIANT
of type VT_NULL . In fact this is documented officially here: DBNull Class
So I suppose using com4j you can create a Variant , call setType (VT_NULL), and pass this to the .NET interop layer.
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.