JAVA开发12--将oracle查询结果赋值给JAVA变量

        List<String> account_filter=new ArrayList<String>();  //数组
        String sql_account_filter = "select distinct object_code as account from inner_table_account where object_source = 'OA_FEE_BUDGET'";
        Connection conn_af = DBUtil.getConnection();
        Statement st_af = conn_af.prepareStatement(sql_account_filter);
        ResultSet eq_af = st_af.executeQuery(sql_account_filter);
        while(eq_af.next()){
            
            account_filter.add(eq_af.getNString("account")) ;
            
        }
        st_af.close();
        conn_af.close();
       
posted @ 2016-10-26 18:03  Stepheng  阅读(65)  评论(0)    收藏  举报