<%@ 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 ------------------------------- %> <% String student="consultant"; /* 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 { PreparedStatement stmt = null,stmt1=null; String subscribe="",turnover=""; Statement statement = null,statement1 = null,statement2 = null; int number =0,number1=0; String loginname=null,password=null,name=null,sex=null,address=null,type=null,address2=null,zipcode=null,phone=null,fax=null,email=null,state=null,country=null,url=null,mesg=null,working=null,size=null,feature=null,Type=null,noofbranches=null,headaddress=null,operational=null,company; loginname = (String)session.getValue("loginname"); password = (String)session.getValue("password"); type= (String) session.getValue("type"); log(""+loginname); int onofbran=0; int subscribeID=0,count=0; int num=0; if ((loginname.length() !=0) && (password.length() !=0) && (loginname != null) && (password != null)) { statement =con.createStatement(); statement.executeQuery("select * from Master where LoginName='"+loginname+"'"); ResultSet rs2 = statement.getResultSet(); rs2.next(); number = rs2.getInt(1); name =rs2.getString(4); sex=rs2.getString(5); address=rs2.getString(6); zipcode=rs2.getString(7); phone=rs2.getString(8); fax=rs2.getString(9); email=rs2.getString(10); state=rs2.getString(11); country=rs2.getString(12); company=rs2.getString(13); url=rs2.getString(14); rs2.close(); statement.close(); //System.out.println("number ="+number); log("number ="+number); statement1 =con.createStatement(); statement1.executeQuery("select * from Software_company where Master_id="+number+""); ResultSet rs3 = statement1.getResultSet(); boolean temp=rs3.next(); System.out.println(" tempedit software company "+ temp); working = rs3.getString(3); size = rs3.getString(4); log("size"+size); feature = rs3.getString(5); turnover = rs3.getString(6); Type = rs3.getString(7); operational = rs3.getString(8); onofbran = rs3.getInt(9); headaddress = rs3.getString(10); log("headaddress "+headaddress ); rs3.close(); statement1.close(); //System.out.println("number ="+ number+" working "+ working+" size "+size+" feature "+feature +" turnover "+turnover +" Type "+Type +" operational "+ operational +" onofbran "+onofbran+ " headaddress"+headaddress ); log("number ="+ number+" working "+ working+" size "+size+" feature "+feature +" turnover "+turnover +" Type "+Type +" operational "+ operational +" onofbran "+onofbran+ " headaddress"+headaddress ); if(name == null) name = ""; if(sex == null) sex = ""; if(address == null) address = ""; if(zipcode == null) zipcode =""; if(phone == null) phone = ""; if(fax == null) fax = ""; if(email == null) email = ""; if(state == null) state = ""; if(country == null || country.equals("Select country")) country = "Select country"; if(url == null) url = ""; if(working == null) working = ""; if(company == null ) company =""; if(feature == null ) feature =""; name=name.trim(); address=address.trim(); zipcode=zipcode.trim(); phone=phone.trim(); fax=fax.trim(); email=email.trim(); state=state.trim(); country=country.trim(); url=url.trim(); working = working.trim(); size = size.trim(); feature = feature.trim(); headaddress = headaddress.trim(); Type=Type.trim(); operational =operational.trim(); company = company.trim(); String Sub_type=null; String Sub_type1=null; statement2 = con.createStatement(); statement2.executeQuery("select * from Subscribe order by Id"); ResultSet rs1 = statement2.getResultSet(); while(rs1.next()) { count++; Sub_type="Subscribe "+count; Sub_type1="Subscribe1 "+count; // String hh=rs1.getString(2); // System.out.println(" hh "+hh); session.putValue(Sub_type,rs1.getString(1)); session.putValue(Sub_type1,rs1.getString(2)); } statement2.close(); //statement1 = con.createStatement(); int l=0; ArrayList al = new ArrayList(); stmt1 = con.prepareStatement("select * from Subcsribe_client where Master_id=?"); stmt1.setInt(1,number); rs3 = stmt1.executeQuery(); while (rs3.next()) { al.add(l,rs3.getString(3)); l++; } session.putValue("selectedlist",al); %> <%@ include file="jobsonline_editsoft.jsp" %> <% }else { %> <%@ include file="jobsonline_loginerror1.htm" %> <% } }catch(Exception ex) { log("e"+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); } } %>