How can I use C # System.DBNull.value in Java?

I am translating code written in C # in Java. This code uses COM objects to interact with a third-party application. I managed to process COM objects using the com4j library, but one of the methods requires that System.DBNull.value , which is a C # object, be passed to it.

How can I process it from a Java application?

+6
source share
1 answer

The .NET System.DBNull equivalent to VARIANT type VT_NULL . This is actually officially registered here: DBNull class

So, I assume that with com4j you can create a Variant , call setType (VT_NULL) and pass this to the .NET interoperability level.

+4
source

Source: https://habr.com/ru/post/943969/


All Articles