如果是报错SQLException,那是因为:
if a database access error occurs or the result set type is TYPE_FORWARD_ONLY
if a database access error occurs or the result set type is TYPE_FORWARD_ONLY
解决方案 »
- Struts+Spring的dispatchaction问题
- 导入节点xml 出现中文乱码问题,在后台控制台打印能正常显示
- 在Struts2中使用showModalDialog打开一个窗体时的错误!!!!
- [求助]activeMQ安全设置问题?:)
- 关于Struts的org.apache.struts包问题
- hibernate 中resource not found的问题
- 请问如何配置WebLogic8.1+JBuilder9
- 安装WebLogic Workshop 8.1问题,请各位帮帮忙了
- 发布ejb的问题,大家进来看看
- weblogic使用问题?
- 找个懂STRUTS的JAVA程序员
- 关于tomcat 的问题!!!
Connection.createStatement(int resultSetType,int resultSetConcurrency)
第一个参数
resultSetType
=ResultSet.TYPE_FORWARD_ONLY 游标只能往前,即只能用next(),不能用previous()
=ResultSet.TYPE_SCROLL_INSENSITIVE 游标可以双向滚动
=ResultSet.TYPE_SCROLL_SENSITIVE 游标可以双向滚动,而且结果集是实时更新的
第二个参数
resultSetConcurrency
=ResultSet.CONCUR_READ_ONLY 返回只读结果集
=ResultSet.CONCUR_UPDATABLE 返回可更新的结果集
public Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws SQLExceptionCreates 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
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);