com.microsoft.sqlserver.jdbc.SQLServerException: only result set is the requested operation is not supported.

com.microsoft.sqlserver.jdbc.SQLServerException: only result set is unsupported support the requested operation.

 

Solution: Because when creating stmt container, without adding the following parameters:

 

con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);

 

con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);

 

 

 

 

It is intended to create a scrollable result set

 

If you do not add this parameter, then the result can only be set once the iteration, it can not rs.XXXX call some method in the ResultSet

Published 70 original articles · won praise 1 · views 480

Guess you like

Origin blog.csdn.net/zhupengqq1/article/details/103954041