Java Stored Procedure Vs PL/SQL Stored Procedure(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 存储过程之间切换),所以这会降低性能吗?
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 存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Java 存储过程与 PL/SQL 存储过程


基础教程推荐
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01