关于connection的一个方法看不懂,请高手帮忙。

MYLOVETPP 2003-10-17 12:18:08

createStatement(int resultSetType, int resultSetConcurrency)
static int CONCUR_READ_ONLY
The constant indicating the concurrency mode for a ResultSet object that may NOT be updated.
static int CONCUR_UPDATABLE
The constant indicating the concurrency mode for a ResultSet object that may be updated.
static int FETCH_FORWARD
The constant indicating that the rows in a result set will be processed in a forward direction; first-to-last.
static int FETCH_REVERSE
The constant indicating that the rows in a result set will be processed in a reverse direction; last-to-first.
static int FETCH_UNKNOWN
The constant indicating that the order in which rows in a result set will be processed is unknown.
static int TYPE_FORWARD_ONLY
The constant indicating the type for a ResultSet object whose cursor may move only forward.
static int TYPE_SCROLL_INSENSITIVE
The constant indicating the type for a ResultSet object that is scrollable but generally not sensitive to changes made by others.
static int TYPE_SCROLL_SENSITIVE
The constant

这个方法里的参数的含义是什么,以及参数代表得意思
我不知到怎么用希望高手指点
...全文
27 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
show90 2003-10-17
  • 打赏
  • 举报
回复
stmt = con.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,java.sql.ResultSet.CONCUR_READ_ONLY); 是这么用的了有CONCUR 是游标

MYLOVETPP 2003-10-17
  • 打赏
  • 举报
回复
能将上面的翻译一下吗?我E文比较差
xwlovesh 2003-10-17
  • 打赏
  • 举报
回复
conn.createStatement();参数缺省,表示记录只能一直向前滚。

conn.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,java.sql.ResultSet.CONCUR_READ_ONLY);
如果是以上设置为参数,则记录集存在游标,表示记录能向前和向后滚。
wizard0128 2003-10-17
  • 打赏
  • 举报
回复
createStatement
public Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws SQLException
Creates a Statement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the createStatement method above, but it allows the default result set type and concurrency to be overridden.

Parameters:
resultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
Returns:
a new Statement object that will generate ResultSet objects with the given type and concurrency
Throws:
SQLException - if a database access error occurs or the given parameters are not ResultSet constants indicating type and concurrency

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧