<%@ page import="java.io.*, java.sql.*,java.util.*, java.text.*,spsjobs.*" %> <%! Connection con=null; %> <%! JobsOnlineConnectionPoolS insert=null; %> <% //-----------------------------Code for connection pool begins ------------ insert=new JobsOnlineConnectionPoolS(); boolean conCheck=true; try { con=insert.getConnection(); if (con==null) { Thread.sleep(50); con=insert.getConnection(); if (con==null) { Thread.sleep(50); con=insert.getConnection(); if (con==null) { conCheck=false; } } } if(conCheck){ //--------------------------------First cut ------------------------------- %> <% //String student="student"; /* try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:spsjobsonline"); }catch(Exception e) { System.out.println("error in loading the database"+e); } */ try { Statement statement2 = null; //int number =0; PreparedStatement stmt2 = null,stmt3 = null; //int num=0; String loginname = (String) session.getValue("loginname"); String password = (String) session.getValue("password"); String type = (String) session.getValue("type"); if(loginname != null && password != null && !loginname.equals("") && !password.equals("") ) { String Sub_type=null; String Sub_type1=null; int count=0; statement2 = con.createStatement(); ResultSet rs1=statement2.executeQuery("select * from Subscribe order by Id"); while(rs1.next()) { count++; Sub_type="Subscribe "+count; Sub_type1="Subscribe1 "+count; session.putValue(Sub_type,rs1.getString(1)); session.putValue(Sub_type1,rs1.getString(2)); } statement2.close(); int l=0; ArrayList al = new ArrayList(); stmt2 = con.prepareStatement("select * from Subcsribe_client where Master_id=(select Id from Master where LoginName=?)"); stmt2.setString(1,loginname); ResultSet rs3= stmt2.executeQuery(); while (rs3.next()) { al.add(l,rs3.getString(3)); l++; } session.putValue("selectedlist",al); stmt3 = con.prepareStatement("delete from Subcsribe_client where Master_id=(select Id from Master where LoginName=?)" ); stmt3.setString(1,loginname); stmt3.executeUpdate(); %> <%@ include file="jobsonline_postvacancy1.jsp" %> <% }else { %> <%@ include file="jobsonline_loginerror1.htm" %> <% } }catch(Exception ex) { log(" ex "+ex); %> <%@ include file="jobsonline_loginerror.htm" %> <% System.out.println("Getting data error "+ex); } %> <% //-------------------------------Second Cut--------------------------------- }//end of if block for connection boolean else{ %> <%@ include file="jobsonline_connection.jsp" %> <% }//end of else block for connection boolean }//end of try catch(Exception ex){ } finally{ try{ if (con!=null){ insert.freeConnection(con); } } catch(Exception e){ } } //-------------------------------close of Second Cut--------------------------------- %>