开发者

Calling dll in Servlet

I have a situation. 开发者_运维问答A device connected to PC(client side) via COM. The vendor provide me a dll to exchange data with the device. I would like to create a java web-app to collect data from many devices(connected to backend through PCs). So how can I call dll from a servlet? Thanks in advanced!


The straight-forward solution is using JNI or JNA. You should learn appropriate tutorial from Oracle to learn how to do this.

But probably you can do it easier. If for example this DLL is ActiveX you can create script (VBScript or JScript) and then run it from java using utility named cscript. Other possibility if this DLL already knows to run as a stand alone application (or you have separate command line app that runs this DLL and provides you CLI.). In this case I'd recommend you to use it unless you have serious performance constraints. It is much easier to run command line application from java than coding JNI.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜