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 是否支持每个连接的多个(并行)操作?
基础教程推荐
- Struts2 URL 无法访问 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
