Oracle DB是否支持每个连接的多个(并行)操作? [英] Does Oracle DB support multiple (parallel) operations per connection?
问题描述
我的Java应用程式需要将游标移至 Oracle DB一段时间。在此期间,必须进行其他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()
)
为了能够有多个打开的ResultSets / Cursor,你需要多个 java.sql.Statement
对象。
To be able to have multiple open ResultSets/Cursors you need multiple java.sql.Statement
objects.
单个连接只能有一个活动(即运行)语句。因此,如果您需要多个打开的游标(ResultSet),则需要依次(一个接一个)运行它们,每个都有自己的 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是否支持每个连接的多个(并行)操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!