<%@ page errorPage="error.jsp" 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 ------------------------------- %> <% /* 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); } */ String loginname,password,type; loginname = (String) session.getValue("loginname"); password = (String) session.getValue("password"); type = (String) session.getValue("type"); System.out.println("loginname"+loginname); //loginname="ganiger"; try { PreparedStatement stmt = null,stmt1=null; Statement statement = null,statement1 = null; int number =0; int num=0; if ((loginname.length() !=0) && (password.length() !=0) && (loginname != null) && (password != null) ) { try{ // statement1 = con.createStatement(); // ResultSet rs1=statement1.executeQuery("select * from Master where LoginName='"+loginname+"'"); stmt1 = con.prepareStatement("select * from Master where LoginName= ?"); stmt1.setString(1,loginname); ResultSet rs1 = stmt1.executeQuery(); rs1.next(); num= rs1.getInt(1); // statement1.close(); System.out.println("num ="+num); }catch(Exception e) { num=0; System.out.println(" master table access "+e); } %> <%@ include file="jobsonline_parteditlist.jsp" %> <% }else { %> <%@ include file="jobsonline_loginerror1.htm" %> <% } }catch(Exception 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--------------------------------- %> <%! public void jspDestroy(){ try{ if(con != null) con.close(); }catch(Exception close){ System.out.println("unable to execute connnection close :"+close); } } %>