简体   繁体   English

使用C#读取“ Java” db4o数据库时,JavaSupport的替代方法是什么?

[英]What's the alternative to JavaSupport when using C# to read “Java” db4o databases?

I'm working with a db4o database that was created in Java, but I'm using C#. 我正在使用用Java创建的db4o数据库,但是我正在使用C#。

The code I'm using is based on an example from the Versant site 我使用的代码基于Versant网站的示例

However, the Db4objects.Db4o.Config.JavaSupport class used in the example is marked as obsolete in the latest (since 8.0) versions of the db4o assemblies. 但是,该示例中使用的Db4objects.Db4o.Config.JavaSupport类在db4o程序集的最新版本(从8.0版本开始)中被标记为过时的。

Is there a new approach when reading Java objects from a db4o database using C#? 使用C#从db4o数据库读取Java对象时,是否有新方法? If so, can someone point me to some sample code for the new approach? 如果是这样,有人可以为我指出新方法的一些示例代码吗? I couldn't find anything when searching. 搜索时找不到任何东西。

Not sure if this works, but maybe worth a try: Use IKVM.NET to run the JAVA version of db4o together with the original Java classes. 不确定这是否可行,但值得一试:使用IKVM.NET与原始Java类一起运行db4o的JAVA版本。 That way you don't need to rely on the not supported 'JavaSupport'-stuff in db4o. 这样,您无需依赖db4o中不受支持的“ JavaSupport”-东西。

I haven't tried it, but I can imagine that it work. 我没有尝试过,但是我可以想象它有效。 I already used IKVM.NET to run other non trivial Java libraries within .NET. 我已经使用IKVM.NET在.NET中运行其他普通的Java库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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