简体   繁体   English

Java存储过程与Java / .Net互操作

[英]Java stored procedures as Java / .Net interop

I'm looking for a way to access a Java API from both a Java console application and an ASP.Net application. 我正在寻找一种从Java控制台应用程序和ASP.Net应用程序访问Java API的方法。

In short my Java API exposes a series of methods for dealing with invoices. 简而言之,我的Java API公开了一系列处理发票的方法。 All of these methods are essentially commands eg 所有这些方法本质上都是命令,例如

  • GenerateAllInvocies GenerateAllInvocies
  • GenerateInvoiceNumber 生成发票编号
  • PrintAllInvoices 打印所有发票
  • PrintInvoiceNumber 打印发票编号

All methods will interact with the database. 所有方法都将与数据库进行交互。 I had believed Web Services was going to be my means for interop. 我曾经相信Web服务将成为互操作的手段。 But I have since been made aware of Java Stored Procedures in Oracle. 但是自那以后,我就知道了Oracle中的Java存储过程。

I believe this means I could essentially treat my stored procs as an API and have the stored procs themselves call appropriate Java to write invoices to disk and to print the invoices etc. However this feels slightly odd. 我相信这意味着我基本上可以将存储的proc视为API,并让存储的proc本身调用适当的Java以将发票写入磁盘并打印发票等。但是,这有点奇怪。

Has anyone out there every used Java stored procedures to provides interop between calling Java and .Net applications before? 以前有没有人使用过每个Java存储过程来提供调用Java和.Net应用程序之间的互操作? Any suggestions? 有什么建议么? Is this a really bad idea? 这真的是个坏主意吗?

Thanks. 谢谢。

This would mean you would access the stored procedures via SQL. 这意味着您将通过SQL访问存储过程。 Given the nature of the calls (as deduced from the names) I find this very counter-intuitive, not to mention you'll tie yourself to oracle. 考虑到调用的性质(从名称推论得出),我发现这很违反直觉,更不用说您将自己束缚在oracle上了。

Why not expose the functionality via web services for the asp.net app and do the same for the command line java app or just access the calls directly. 为什么不通过Web服务为asp.net应用程序公开功能,而对命令行Java应用程序执行相同操作,还是直接访问调用。

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

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