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

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.

链接地址: http://www.djcxy.com/p/71328.html

上一篇: 实体框架5总是尝试连接到sqlexpress而不是本地数据库

下一篇: 我如何在Java中使用C#System.DBNull.value?