在匿名内部类实现监听器,rs = stmt.executeQuery(sql);语句报错:Local variable rs defined in an enclosing scope must be final or effectively final
望采纳!!!!!
Java中为了保证局部变量和内部类中数据一致,内部类访问外部类变量需要用final修饰
//外部类变量
final String sql = "xxxxxx";
// 我是在某某匿名内部类里面的
rs = stmt.executeQuery(sql);