The following code will execute for 160 times in single page load. After 10 to 15 times im getting the following Exception: [Oracle][ODBC][Ora]ORA-12520: TNS:listener could not find available handler for requested type of server
Code is
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;
}
}
Im using this code in JSP