当前位置: 技术问答>java相关
ResultSet,TYPE_FORWARD_ONLY?我不能自由移动游标的位置吗?
来源: 互联网 发布时间:2015-03-13
本文导语: ResultSet rs=stmt.executeQuery("select * from tbname"); rs.absolute(5); //出错:Result set type is TYPE_FORWARD_ONLY 请问有什么方法可以使用,rs.absolute(); 谢谢 | createStatement public Statement createStatement(int resultSetType, ...
ResultSet rs=stmt.executeQuery("select * from tbname");
rs.absolute(5); //出错:Result set type is TYPE_FORWARD_ONLY
请问有什么方法可以使用,rs.absolute();
谢谢
rs.absolute(5); //出错:Result set type is TYPE_FORWARD_ONLY
请问有什么方法可以使用,rs.absolute();
谢谢
|
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
Since:
1.2