Java存储过程与PL/SQL存储过程 [英] Java Stored Procedure Vs PL/SQL Stored Procedure

查看:120
本文介绍了Java存储过程与PL/SQL存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在性能更好的Oracle DBMS中,可以从另一个pl/sql存储过程调用一个Java存储过程,或者从另一个pl/sql存储过程调用一个pl/sql存储过程.

In Oracle DBMS, which is better performance, calling a java stored procedure from another pl/sql stored procedure or calling a pl/sql stored procedure from another pl/sql stored procedure.

通过我的pl/sql过程中有一个循环,该循环将多次调用java过程(即我的代码在PL/SQL和Java存储过程之间切换),所以这会降低性能吗? /p>

By the way I have a loop in my pl/sql procedure that will call the java procedure multiple times (i.e. my code is flipping between PL/SQL and Java Stored Procedures), so does this slow down the performance)?

推荐答案

从一种语言切换到另一种语言都会产生开销(虽然可能很小,但仍会存在).如果在循环中,它将被加重.

Any switch from one language to another will involve an overhead (it might be small but it'll still be there). If it's in a loop it will be accentuated.

请保持简单,如果您可以坚持使用PL/SQL,请这样做.

Keep it simple and if you can stick to PL/SQL then do so.

Tom Kyte(甲骨文公司副总裁兼大师)的口头禅似乎很适合在这里重复:

Tom Kyte (Oracle Corporation Vice President and Guru) has a mantra which seems fitting to repeat here:

(参考: http://tkyte.blogspot.com/2006 /10/slow-by-slow.html )

  • 如果可能的话,您应该在单个SQL语句中执行此操作.
  • 如果您无法在单个SQL语句中执行此操作,请在PL/SQL中执行.
  • 如果您无法在PL/SQL中执行此操作,请尝试使用Java存储过程.
  • 如果您无法使用Java进行操作,请通过C外部过程进行操作.
  • 如果您无法在C外部例程中执行此操作,则可能需要认真考虑为什么需要这样做……

这篇关于Java存储过程与PL/SQL存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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