Connection connection=DriverManager.getConnection(url,"sql_973","datashare");要放到try catch块里,因为可能会抛出ClassNotFoundExceptionrs=statement1.executeQuery(sql);也要放到try catch块里,因为可能会抛出SQLException

解决方案 »

  1.   

    应该是sql语句的问题。像下面这么写:
    String sql="select * from se590_brdf where ob_date = \'" + ob_date + "\' and field_no = \'" + position + "\' and rtrim(ltrim(objection)) = \'冬小麦\' and " + sql_dire;   //sql_dire是什么?
    String sql2 = "select * from 土面反射率_BRDF where ob_date = \'" + ob_date + "\' and field_no = \'" + position+ "\' and ltrim(rtrim(beijing_time)) = \'" + bj_time + "\'";也就是说,在单引号'的前面都加上\
      

  2.   


          for (j=0;j<252;j++)
          {
             ref[0][j]=rs.getFloat(j+10) ;  /********* 它可能会出错越届*******/
          }
      

  3.   

    我试过了,是数据库访问时类型和顺序问题。去掉了rs.TYPE_SCROLL_SENSITIVE,rs.CONCUR_UPDATABLE); 因为我是jdbc_odbc访问数据库。
        回答相关者给分
      

  4.   

    Statement statement1=connection.createStatement(rs.TYPE_SCROLL_SENSITIVE,rs.CONCUR_UPDATABLE);你把参数去掉!或者将第一个参数置forward,JDBC二类驱动程序不支持纵向及横向记录回溯!!
      

  5.   

    thx to everyone! 给分!