用别名啊:strSQL = "select * from" +table + " tb";strSQL=strSQL+"where tb.DocCode='ScopePlan'";

解决方案 »

  1.   

    table=request.getParameter("table");strSQL = "select * from" +table ;strSQL=strSQL+"where table.DocCode='ScopePlan'";提示:ResultSet is closed 。我的SQL语句有错误吗?
      

  2.   

    String table=request.getParameter("table");strSQL = "select * from" +table ;strSQL=strSQL+"where table.DocCode='ScopePlan'";提示:ResultSet is closed 。我的SQL语句有错误吗?
      

  3.   

    啊,提示是这样的呀,那跟sql有什么关系呀!提示不是已经说的很明白了嘛,记录集关闭了呀
      

  4.   

    但是我要是把table赋一具体值(如rest)就能取出正确的值。strSQL = "select * from rest where rest.DocCode='ScopePlan'";
      

  5.   

    那你的table值可能是空的,打印出来看看吧
      

  6.   

    你试试这样行不行strSQL = "select * from " +table + " tb ";strSQL=strSQL+" where tb.DocCode='ScopePlan'";