java.sql.SQLException:不支持的功能:refreshrow

时间:2016-04-27 19:22:52

标签: oracle jdbc

// SensitiveTest.java

import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
class SensitiveTest
{

public static void main(String[]args)throws Exception
{

    Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1522:orcl1","scott","password");
    Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    ResultSet rs=stmt.executeQuery("select * from emp");
    int count=0;
    while(rs.next())
    {
        rs.refreshRow();
        System.out.println(rs.getInt(1)+" "+rs.getString(2)+" "+rs.getInt(6));
        count++;
    if(count==2)
    {
        Thread.sleep(30000);
    }
    }
    rs.close();
    stmt.close();
    con.close();

}

}

它显示编译错误java.sql.SQLException:不支持的功能:refreshrow如何才能解决这个问题

0 个答案:

没有答案