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?
It is a bit more cryptic in its style than some other languages, but you get beyond that fairly quickly. C is what is called a compiled language. This means that once you write your C program, you must run it through a C compiler to turn your program into an executable that the computer can run (execute).
C programming language is majorly used in the creation of hardware devices, operating systems, drivers, kernels, etc. It is also used for the development of GUIs and IDEs. For example: Linux Kernel is written in the C language.
.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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With