什么时候应该将Java存储过程与Oracle数据库一起使用...有哪些缺点? [英] When should you use java stored procedures with an Oracle database ... what are the drawbacks?

查看:57
本文介绍了什么时候应该将Java存储过程与Oracle数据库一起使用...有哪些缺点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PL/SQL不是我的母语. Oracle支持使用Java编写存储过程.与用PL/SQL编写存储过程相比,这样做有什么好处

PL/SQL is not my native tongue. Oracle supports writing stored procedures in Java. What are the advantages of doing this over writing the stored procedures in PL/SQL

推荐答案

在Oracle世界中,一般的开发顺序应为:

In the Oracle world the general order of development should be:

只要有可能,就完全可以使用SQL来完成. 如果您需要的不仅仅是SQL,请使用PL/SQL. 如果您需要PL/SQL无法执行的操作,请使用Java. 如果所有其他方法均失败,请使用C. 如果您无法使用C做到这一点,请慢慢解决问题....

Wherever possible do it purely with SQL. If you need more than SQL do it with PL/SQL. If you need something that PL/SQL can't do, then use Java. If all else fails use C. If you can't do it with C, back slowly away from the problem....

PL/SQL存储过程是将业务逻辑转移到任何集成技术都可以访问的层的绝佳方法.包中的业务逻辑(不要编写独立的函数和过程-它们会以无法管理的方式随着时间的推移而增长)可以由Java,C#,PL/SQL,ODBC等执行.

PL/SQL stored procedures are an excellent way of moving your business logic to a layer that will be accessible by any integration technology. Business Logic in a Package (don't write stand alone Functions and Procedures - they'll grow over time in an unmanageable way) can be executed by Java, C#, PL/SQL, ODBC and so on.

PL/SQL是在纯SQL之外处理大量数据的最快方法. 批量绑定"功能意味着它可以与SQL引擎很好地协同工作.

PL/SQL is the fastest way to throw around huge chunks of data outside of pure SQL. The "Bulk Binding" features means it works very well with the SQL engine.

Java存储过程最适合创建与网络或操作系统交互的功能.例如,发送电子邮件,FTP处理数据,输出到文本文件并将其压缩,一般执行主机命令行.

Java stored procedures are best for creating functionality that interacts with network or operating system. Examples would be, sending emails, FTP'ing data, outputting to text files and zipping it up, executing host command lines in general.

在使用Oracle时,我从来不需要编写任何C语言,但是大概可以将其用于与旧版应用程序集成.

I've never had to code up any C when working with Oracle, but presumably it could be used for integrating with legacy apps.

这篇关于什么时候应该将Java存储过程与Oracle数据库一起使用...有哪些缺点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆