Does Oracle DB support multiple (parallel) operations per connection?(Oracle DB 是否支持每个连接的多个(并行)操作?)
问题描述
我的 Java 应用程序需要将光标保持在 Oracle DB 上一段时间.在此期间,必须进行其他 DB 语句.这需要单独的数据库连接还是可以使用相同的(光标的)?
My Java application needs to hold cursor to Oracle DB for some time. During it other DB statements have to be made. Does this require separate DB connections or same (cursor's one) can be used?
谢谢.
推荐答案
唯一的限制是单个语句在给定时间只能有一个 ResultSet.请注意,一个语句可以生成多个 ResultSet,但您必须按顺序访问它们(使用 getNextResult())
The only restriction is that a single statement can only have a single ResultSet at a given time. Note that a statement can produce multiple ResultSets but you have to access them sequentially (using getNextResult())
为了能够拥有多个打开的结果集/游标,您需要多个 java.sql.Statement 对象.
To be able to have multiple open ResultSets/Cursors you need multiple java.sql.Statement objects.
单个连接只能有一个活动(即正在运行)语句.因此,如果您需要多个打开的游标(结果集),您需要按顺序(一个接一个)运行它们,每个游标都有自己的 Statement 对象.
A single connection can only have a single active (i.e. running) statement. So if you have need multiple open cursors (ResultSets) you need to run them sequentially (one after the other) each with their own Statement object.
这篇关于Oracle DB 是否支持每个连接的多个(并行)操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Oracle DB 是否支持每个连接的多个(并行)操作?
基础教程推荐
- 大摇大摆的枚举 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
