Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java “我们只是丢弃它。好的。实际上,我在数据库中显示了344个值,但只显示了299个。例外情况是ORA=01000:最大打开游标数超过@这是因为您没有关闭在while循环中打开的语句。请参阅下面的不同答案。如果发生异常而您没有注意到它,因为您只是在丢弃它,该怎_Java_Jsp_Playframework_Playframework 1.x - Fatal编程技术网

Java “我们只是丢弃它。好的。实际上,我在数据库中显示了344个值,但只显示了299个。例外情况是ORA=01000:最大打开游标数超过@这是因为您没有关闭在while循环中打开的语句。请参阅下面的不同答案。如果发生异常而您没有注意到它,因为您只是在丢弃它,该怎

Java “我们只是丢弃它。好的。实际上,我在数据库中显示了344个值,但只显示了299个。例外情况是ORA=01000:最大打开游标数超过@这是因为您没有关闭在while循环中打开的语句。请参阅下面的不同答案。如果发生异常而您没有注意到它,因为您只是在丢弃它,该怎,java,jsp,playframework,playframework-1.x,Java,Jsp,Playframework,Playframework 1.x,“我们只是丢弃它。好的。实际上,我在数据库中显示了344个值,但只显示了299个。例外情况是ORA=01000:最大打开游标数超过@这是因为您没有关闭在while循环中打开的语句。请参阅下面的不同答案。如果发生异常而您没有注意到它,因为您只是在丢弃它,该怎么办。好的。实际上,我在数据库中显示了344个值,但只显示了299个。例外情况是ORA=01000:最大打开游标数超过@这是因为您没有关闭在while循环中打开的语句。请参阅下面的不同答案。不要忽略异常,特别是在使用系统资源(如DB连接或套接字


“我们只是丢弃它。好的。实际上,我在数据库中显示了344个值,但只显示了299个。例外情况是ORA=01000:最大打开游标数超过@这是因为您没有关闭在
while
循环中打开的语句。请参阅下面的不同答案。如果发生异常而您没有注意到它,因为您只是在丢弃它,该怎么办。好的。实际上,我在数据库中显示了344个值,但只显示了299个。例外情况是ORA=01000:最大打开游标数超过@这是因为您没有关闭在
while
循环中打开的语句。请参阅下面的不同答案。不要忽略异常,特别是在使用系统资源(如DB连接或套接字)时。请帮助我关闭结果集或连接的位置@Narendra Pathai
catch(异常e){//e.printStackTrace();con.close();rs.close();}
如果不这样做,则会逐个使用数据库游标,并最终耗尽。您可以在Windows命令提示符下检查netstat命令,您会发现会有许多与数据库socket的打开连接永不忽略异常,特别是当您使用系统资源(如数据库连接或套接字)时。请您帮助我在何处关闭结果集或连接@Narendra Pathai
catch(异常e){//e.printStackTrace();con.close();rs.close();}
如果不这样做,则会使用一个接一个的数据库游标并最终耗尽。您可以在Windows命令提示符下检查netstat命令,您将看到有许多打开的数据库套接字连接
public static void updateChallan(){
    ChallanNumber pd=null;
    int i=0;
    String customerName="";
    List<ChallanNumber> challanList= new ArrayList<ChallanNumber>();
    Connection con = DB.getConnection();
    try
    {
    String st="select CHALLAN_NUMBER,CUSTOMER_CODE,CHALLAN_DATE from DELIVERY_CHALLAN_DETAILS order by CHALLAN_NUMBER";
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(st);
    while(rs.next())
    {
        String stCustName="select CUSTOMER_NAME from CUSTOMER_DETAILS where CUSTOMER_CODE='"+rs.getString(2)+"'";
        Statement stmtCustName=con.createStatement();
        ResultSet rsCustName=stmtCustName.executeQuery(stCustName);
        while(rsCustName.next()){
            customerName=rsCustName.getString(1);
        }

        customerName=rsCustName.getString(1);
        //System.out.println(customerName +" "+i);
        pd=new ChallanNumber(rs.getString(1),customerName,rs.getString(3));
        challanList.add(i,pd);
        i++;
    }
    }
    catch(Exception e)
    {
        //e.printStackTrace();
    }
    render(challanList);
}
<select name="challanNumber" id="challanNumber">
              <option value="selected" selected="selected">ChallanNumber-CustomerCode-    Date</option>

              #{list challanList, as:'cl'}

              <option value="${cl.challanNumber}">${cl.challanNumber}(${cl.customercode}-${cl.challanDate})</option>

                #{/list}



            </select>
public static void updateChallan() throws Exception {
    ChallanNumber pd = null;
    int i=0;
    String customerName = "";
    List<ChallanNumber> challanList= new ArrayList<ChallanNumber>();
    Connection con = DB.getConnection();
    Statement stmt = null;
    try {
        String st = "select CHALLAN_NUMBER,CUSTOMER_CODE,CHALLAN_DATE from DELIVERY_CHALLAN_DETAILS order by CHALLAN_NUMBER";
        stmt = con.createStatement();
        ResultSet rs = stmt.executeQuery(st);
        while (rs.next()) {
            String stCustName = "select CUSTOMER_NAME from CUSTOMER_DETAILS where CUSTOMER_CODE='" + rs.getString(2) + "'";
            Statement stmtCustName = con.createStatement();
            try {
                ResultSet rsCustName = stmtCustName.executeQuery(stCustName);
                while (rsCustName.next()){
                    customerName = rsCustName.getString(1);
                }
            } finally {
                if (stmtCustName != null) 
                    stmtCustName.close();
            }

            customerName = rsCustName.getString(1);
            //System.out.println(customerName +" "+i);
            pd = new ChallanNumber(rs.getString(1), customerName, rs.getString(3));
            challanList.add(i, pd);
            i++;
        }
    } catch(Exception e) {
        e.printStackTrace();
    } finally {
        if (stmt != null) 
            stmt.close();
    }
    render(challanList);
}