0

以下代码将在单页加载中执行 160 次。在 10 到 15 次后,我得到以下异常: [Oracle][ODBC][Ora]ORA-12520: TNS:listener could not find available handler for requested type of server

代码是

 package ServletPkg;

import java.sql.*;
public class CheckSeat {


public boolean checkSeat(String seatNo,String showID)
{
    Statement stmt;
ResultSet rs;
Connection con;
boolean m=false;
String seat=seatNo;
String show=showID;
try
{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:ob","Online_Booking","password");
   stmt = con.createStatement();
   rs = stmt.executeQuery("select * from booking_info where book_seat like '%"+seat+"%' and show_id = '"+show+"'");
   if(rs.next())
   {
       m=true;
       System.out.println("Seat Selected");
   }
   con.close();
 }

 catch(Exception e)
 {
    System.out.println(e.getMessage());
 }
    return m;
}
}

我在 JSP 中使用此代码

4

0 回答 0