package bancmate.utility.

function; import import import import import import import import import import import import java.io.BufferedReader; java.io.File; java.io.FileInputStream; java.io.FileOutputStream; java.io.FileReader; java.io.InputStream; java.io.PrintStream; java.sql.PreparedStatement; java.sql.ResultSet; java.util.ArrayList; java.util.HashMap; java.util.Iterator;

import org.apache.axis.encoding.Base64; import import import import bancmate.common.dataclasses.DataBaseClass; bancmate.common.dto.BMConfig; bancmate.common.globalfunction.GiveCommonParameter; bancmate.common.parameter.CommonParameter;

public class ImportGeodesicData { /* @Author :- Ankit Jain @Purpose :- Import The Geodesic HHT Enrolled Data Into The FI Server @Date :- 14-11-2011 */ ArrayList mapValuesArrayList=new ArrayList(); FileInputStream fileInPutStream=null; FileOutputStream fileOutputStreamLog =null; PrintStream printStreamLog =null; int count=0 ; int newInsert=0; int oldUpdate=0; int alreadyUpdate=0; int phtNotAvailCount=0; int fingerNotAvailCount=0; String sCUSTOMER_ID=""; String sACCOUNT_NUMBER=""; String sCUSTOMER_TITLE=""; String sDD_CTITLE_TEXT=""; String sCUSTOMER_NAME=""; String sCUSTOMER_SEX=""; String sDD_CSEX_TEXT=""; String sDATE_OF_BIRTH=""; String sCOMMUNITY=""; String sDD_COMMUNITY_TEXT=""; String sADDRESS_1=""; String sVillage_Ename=""; String sVILLAGE_CODE=""; String sDD_CITY_TEXT=""; String sDD_STATE_TEXT=""; String sPINCODE=""; String sGUARDIAN_CODE=""; String sDD_GUARDIAN_TEXT=""; String sGUARDIAN_NAME=""; String sNOMINEE_NAME=""; String sNOMINEE_RELATION_CODE=""; String sDD_RELCODE_TEXT="";

String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String String

sNOMINEE_DOB=""; sINTRODUCER_TITLE=""; sDD_ITITLE_TEXT=""; sINTRODUCER_NAME=""; sLAST_UPDATED_DATE=""; sSTATUS=""; sNOMINEE_FH_NAME=""; sOCCUPATION_CODE=""; sDD_OCCUPATION_TEXT=""; sFA_NAME=""; sMO_NAME=""; sIDTYPE_CODE=""; sDD_IDTYPE_TEXT=""; sIDNUMBER=""; sMARITAL_STATUS_CODE=""; sDD_MARITAL_STATUS=""; sCATEGORY_CODE=""; sDD_CATEGORY_TEXT=""; sHUSBAND_NAME=""; sSPOUSE_NAME=""; sUID_NUMBER=""; sUID_ISSUE_DATE=""; sSPOUSE_OCCUPATION=""; sGROSS_INCOME=""; sNET_INCOME=""; sPAN_NUMBER=""; sRELIGION=""; sCASTE=""; sCLASS=""; sEDUCATION=""; sLH_COUNTRY=""; sLH_STATE=""; sLH_DISTRICT=""; sLH_CITY=""; sLH_BLOCK=""; sLH_PANCHAYAT=""; sLH_VILLAGE=""; sLH_SURVEY_NUM=""; sLH_TITLE_NAME=""; sLH_LAND_AREA=""; sLH_RES_OWNER=""; sLH_IRRIGATION=""; sLH_SOURCE_IRRIGATION=""; sLH_ENCUMBRANCE=""; cityCode=""; stateCode=""; sBrancode=""; nomGender=""; custNatureCode=""; addrDocIssuAuth=""; addrDocIssuPlace=""; addrIssuDate=""; addrExpDate=""; glCode=""; pensionId=""; naregaNumber=""; habCode=""; age=""; adrCerCode=""; adrDocNo="";

String iac_minor="N"; String iac_grdyn="N"; String iac_nomyn=""; String cstKid="0"; String sVillageKid="0"; String sVillageDistid="0"; String sVillageStateid="0"; String sPanchayatId="0"; String ocpID="0"; String catID="0"; String cityID="0"; String rlgnKid="0"; String edukid ="0"; String custNature="0"; String sMop="0"; String classId="0"; String glKid="0"; String cntvillmapkid=""; String cntId="0"; String segid="0"; int sNomAge=0; String signDB=BMConfig.getProperty("SIGNDB"); ResultSet rs1=null; String userid=""; public ImportGeodesicData(java.sql.Date sDate,String userid) throws Exce ption{ String fLogFile=""; fLogFile=BMConfig.getProperty("HhtDataPath"); fLogFile=fLogFile+"_"+sDate+"_uploadErrorLog.txt"; this.userid=userid; fileOutputStreamLog=new FileOutputStream(fLogFile,true); printStreamLog=new PrintStream(fileOutputStreamLog,true); } public String getFormatedDate(String sDate){ boolean bDate; String sYear=""; String sMonth=""; String sDays=""; sDate=sDate.replaceAll("'", ""); if(sDate.length()==8){ sYear=sDate.substring(4,8).trim(); sMonth=sDate.substring(2,4).trim(); if(Integer.parseInt(sMonth)>12 || Integer.parseInt(sMont h)==0 ){ bDate=false; return sDate; } sDays=sDate.substring(0,2).trim(); if(Integer.parseInt(sDays)>31 || Integer.parseInt(sDays) ==0){ bDate=false; return sDate; } sDate=sYear.trim()+"-"+sMonth.trim()+"-"+sDays.trim(); } else{ bDate=false; } if(sDate.length()!=10){ bDate=false;

} return sDate; } public HashMap <String, Object> InsertDataIntoTempTable(DataBaseClass db ,String dataFiles,java.sql.Date ssDate,String bankName,String bankCode,String ge odesicDataType) { HashMap <String,Object> savedDataInfo=new HashMap <String, Objec t>(); int totalCount=0; int wrongFormatRecords=0; int duplicateRecords=0; String sDate=ssDate+""; String dirNm=""; File infolder = new File(dataFiles); String[]file = infolder.list(); dirNm=infolder.getName(); String mainFileName=dirNm; String hhtImpHisKid=""; printStreamLog.println("======================================== ==========================================================================="); printStreamLog.println("==============================["+dirNm+" ]=============================="); printStreamLog.println("======================================== ==========================================================================="); try{ if(file.length>0){ ResultSet rs1=null; String strhhtimphisCheck="select hhtimphis_kid f rom s_hhtimphis where hhtimphis_flag='N' and hhtimphis_name='"+dirNm+"'"; rs1=db.db_select(strhhtimphisCheck); while(rs1.next()){ hhtImpHisKid=(rs1.getString(1)); } if(hhtImpHisKid.equals("")){ String hhtImpHisInsert="Insert into s_hh tImpHis (hhtImpHis_name,hhtImpHis_date,hhtimphis_flag)values('"+dirNm+"','"+sDat e+"','N')"; hhtImpHisKid=db.db_Insert(hhtImpHisInser t); } for(int k=0;k<file.length;k++){ File dir = new File(dataFiles+"/"+file[k ]); File[] files = dir.listFiles(); dirNm=dir.getName(); String phtFlag="N"; String fingerFlag="N"; String docPhtFlag="N"; String subStrPhtCustId=""; String subStrDocPhtCustId=""; byte[] phtBytes = null; byte[] docPhtBytes = null; ArrayList <String>fingerArr=new ArrayLis t<String>(); PreparedStatement pstmt=null; String txtFileExist="NO"; String[] recordString=null; if (files != null){ for(int j=0; j<files.length; j++ ){

File filename = files[j] ; String filePath=""+filen ame; for(int f=0;f<files.leng th;f++){ File filename1 = files[f]; filename1.getNam e(); String filePath1 =""+filename1; if(filePath1.toS tring().contains("crop") && ( filePath1.endsWith(".jpg") || filePath1.endsWith(" .jpeg"))){ subStrPh tCustId=filename1.getName().replace("crop.jpg", ""); File obj =new File(filePath1); phtBytes = new byte[(int)obj.length ()]; fileInPu tStream= new FileInputStream(obj); fileInPu tStream.read (phtBytes); if(phtBy tes.length>0){ phtFlag="Avail"; } } if(filePath1.toS tring().contains("proof") && ( filePath1.endsWith(".jpg") || filePath1.endsWith( ".jpeg"))){ subStrDo cPhtCustId=filename1.getName().replace("proof.jpg", ""); File obj =new File(filePath1); docPhtBy tes = new byte[(int)obj.length ()]; fileInPu tStream= new FileInputStream(obj); fileInPu tStream.read (docPhtBytes); if(docPh tBytes.length>0){ docPhtFlag="Avail"; } } } if(filePath.endsWith(".t xt")){ txtFileExist="YE S"; FileReader fileR eader = new FileReader(filePath); BufferedReader b ufferedReader = new BufferedReader(fileReader); String stringRea

String insertAlready="".equals("NA") && !recordString[7]. String isValid ="". stringRe adLine = stringReadLine.substring(0.split("!"). recordString[i]=dateCalc.4))-Integer.length.replace("-". recordSt ring=stringReadLine. if(dirNm . stringRe adLine=stringReadLine.parseInt(recordSt ring[7].readLine())!= null)// Read Line by Line From .equals("")||recordString[i]==null?"NA":recordSt ring[i].sDate.equals("NA")){ recordString[i]=Integer.geodesicDataType).substring(4.txt file an d insert into Temp Table if Record Is In Proper Format { totalCou nt++.bankName." "). isValid= isRecordValid(stringReadLine.8)+dateCalc.parseInt(sDate.equals("")||recordString[i]==null?getFormatedDa te(sDate):getFormatedDate(recordString[i]). } .dLine = "".i<recordString.substring(6. } if(i==7){ recordString[i] =recordString[i].equals(recordString[0])){ for(int i=0.equals("")){ int dobFromAge=Integer.equals("")||recordString[i]==null?getFormatedDa te(sDate):getFormatedDate(recordString[i]).4))+""."!").replace("-". "").bankCode.parseInt(recordStr ing[79]). else recordString[i] =recordString[i]."").replace("|".parseInt(sDate.replaceAll(". while((stringRea dLine = bufferedReader. String dateCalc=sDate.substring(0. if(i==7 && recordString[i].substring(0.equals("NA") && !recordString[79]. } if(i==79 && recordString[i].4))-Integer.i++){ //Set Value From Blank To "NA" OR From Blank-Date To "01011900" if ( i==22 || i== 26 || i==43 || i==73 || i==74 ) recordString[i] =recordString[i].".db.6)+dobFromAge.

if(phtFlag. if(!isValid.length()> 40 ){ recordString[i]=recordString[i].equalsIgnoreCase("State Bank of Hyderabad" )|| bankCode.equals(subStrPhtCustId)) phtFlag="Y".equals(subStrDocPhtCustId)) docPhtFlag="Y". 38).length.length>82){ for(int i=82.add(recordString[i]).i++){ if(!recordString[i].equals("Avail") && recordString[0]. if(docPhtFlag.i<recordString. } } if(fingerArr. } } //fetch fingerString from text file and add them into an arrayList if(recordString.equals("NA")?"1900-01-01":recordString[7].substring(0. if((bankName.equalsIgnoreCase("wrongFormat")){ recordString[7]=recordString[7].equals("Avail") && recordString[0].size()>0) fingerFlag="Y".trim().if(i==10 && recordString[i].equals("NA") && recordString[i]!=null) fingerArr. else fingerFlag="N". else phtFlag="N".equals("NA")){ String checkDup=" SELECT TEMPINS_KID from s_HHTInsert where PENSIONID='"+record String[76]+"' and HABCODE='"+recordString[78]+"' and IS_IMPORT='N' " .equals("004 ")) ){ if(!recordString[76]. else docPhtFlag="N". .

} .next()){ insertAlready1=rs.db_select(checkDup). while(rs.next()){ insertAlready=rs.getString(1). ResultSet rs=db. rs=db. } } else{ String checkDup=" SELECT TEMPINS_KID from s_HHTInsert where CUSTOMERID='"+recor dString[0]+"' and IS_IMPORT='N' " .getString(1). String insertAlready1="". } if(!insertAlready1. while(rs. } checkDup=" SELECT TEMPINS_KID from s_HHTInsert where CUSTOMERID='"+recordString [0]+"' and IS_IMPORT='Y' " .getString(1).next()){ insertAlready1=rs. while(rs.db_select(checkDup).equals("")){ db. insertAlready="".db_select(checkDup).ResultSet rs=db.getString(1). while(rs. rs=db.db_select(checkDup). } checkDup=" SELECT TEMPINS_KID from s_HHTInsert where PENSIONID='"+recordString[ 76]+"' and HABCODE='"+recordString[78]+"' and IS_IMPORT='Y' " . insertAlready="".db_delete(" Delete from s_hhtinsert where TEMPINS_KID='"+insertAlready1+"' " ).next()){ insertAlready=rs. String insertAlready1="".

while(rs.equals("")){ db.next()){ insertAlread1=rs. insertAlready="". while(rs.next()){ insertAlready=rs. rs=db.equals("")){ db. rs=db. while(rs.getString(1). String insertAlread1="".db_select(checkDup). } if(!insertAlread1. ResultSet rs=db.db_delete(" Delete from s_hhtinsert where TEMPINS_KID='"+insertAlready1+"' " ).db_delete(" Delete from s_hhtinsert where TEMPINS_KID='"+insertAlread1+"' " ) . .db_select(checkDup). } } } } else{ String checkDup=" SELECT TEMPINS_KID from s_HHTInsert where CUSTOMERID='"+reco rdString[0]+"' AND is_import='N' " .equals("")){ String checkDup1=" SELECT TEMPINS_KID from s_HHTInsert where DATE_OF_BIRTH='"+ recordString[7]+"' and CUSTOMER_NAME='"+recordString[4]+"' and FA_NAME='"+reco rdString[31]+"' and is_import='N' " .getString(1). } checkDup=" SELECT TEMPINS_KID from s_HHTInsert where DATE_OF_BIRTH='"+recordSt ring[7]+"' and CUSTOMER_NAME='"+recordString[4]+"' and FA_NAME='"+recordString [31]+"' and is_import='Y' " .if(!insertAlready1.db_select(checkDup1). } if(insertAlready.getString(1).next()){ insertAlready=rs.

rs=db.next()){ insertAlready=rs. rs=db.next()){ insertAlread1=rs. } checkDup=" SELECT TEMPINS_KID from s_HHTInsert where DATE_OF_BIRTH='"+recordSt ring[7]+"' and CUSTOMER_NAME='"+recordString[4]+"' and FA_NAME='"+recordString [31]+"' and is_import='Y' " . String insertAlready1="".db_delete(" Delete from s_hhtinsert where TEMPINS_KID='"+insertAlready1+"' " ). } if(!insertAlready1. rs=db.getString(1).} checkDup=" SELECT TEMPINS_KID from s_HHTInsert where CUSTOMERID='"+recordStrin g[0]+"' and is_import='Y' " . } . insertAlready="". while(rs.equals("")){ db. while(rs. } if(!insertAlread1. while(rs.getString(1).db_delete(" Delete from s_hhtinsert where TEMPINS_KID='"+insertAlread1+"' " ) .equals("")){ String checkDup1=" SELECT TEMPINS_KID from s_HHTInsert where DATE_OF_BIRTH='"+ recordString[7]+"' and CUSTOMER_NAME='"+recordString[4]+"' and FA_NAME='"+reco rdString[31]+"' and is_import='N' " .db_select(checkDup). } if(insertAlready.getString(1). String insertAlread1="".next()){ insertAlready1=rs.db_select(checkDup).db_select(checkDup1).equals("")){ db.

COMMUNITY.HUSBAND_NAME.finger_10.GL CODE.DD_ CTITLE_TEXT." + "DD_CATEGORY_TEXT. } /* String sql="INSERT INTO S_HHTNOTIMP (CustomerId.'"+recordString[15]+"'.CLASS.RELIGION.DD_MARITAL_STAT US.finger_3.HABCODE.CITY_CODE.' "+recordString[9]+"'.NOMINEE_RELATION_CODE.is_photo.is_docphoto.NOMINEE_FH_NAME.'"+recordString[11]+"'.LH_SURVEY_NUM.PINCODE.finger_9." + "NOMINEE_NAME.LH_CITY.'" + ""+recordString[4] +"'." + "finger_6.finger_1.IDNUMBER. GUARDIAN_NAME.UID_ISSUE_DATE.LH_TITLE_NAME.V ILLAGE_ENAME.DD_CSEX_TEXT." + "LH_PANCHAYAT.'"+recordString[1]+"'.SPOUSE_OCCU PATION.SPOUSE_NAME.'" + .'"+recordString[12]+"'.LH_COUNTRY.DD_ITITLE_TEXT.ADRCERCODE.'"+recordString[2]+"'.PENSIONID.CUSTOMER_TITLE.finger_8.AdrDocIssPlace.} } if(insertAlready.imp_date ) " + " VALUES ('"+recordString[0]+"'.PAN_NUMBER.NOMINEE_DOB.DD_COMMUNITY_TEXT.LH_RES_OWNER." + "LH_SOURCE_IRRIGATION.'" + ""+recordString[10]+"'.LH_ENCUMBRANCE.DD_STATE_TEXT.finger_4.MARITAL_STATUS_CODE." + "INTRODUCER_NAME.AccountNumber.finger_7.ADRDOCNO.f inger_5.'"+recordString[6] +"'.'"+recordSt ring[7] +"'.LH_VILLAGE." + "NET_INCOME.LH_BLOCK." + "CUSTOMER_SEX." + "VILLAGE_CODE.GROSS_INCOME.AdrDocIssuAuth." + "CustNature.NomSex.' "+recordString[8]+"'.STATE_CODE.LH_STATE.Doc_photo.CATEGORY_CODE.IDTYPE_CODE.CUSTOMER_NAME.UID_NUMBER.GUARDIAN_CODE.'"+ recordString[3]+"'.DD_CITY_TEXT.CASTE.AdrExpDate.LH_DIS TRICT.DD_GUARDIAN_TEXT.DD_OCC UPATION_TEXT.EDUCATION.'"+recordString[5] +"'." + "MO_NAME." + "NAREGA_NO.LH_LAND_AREA.photo.DATE_OF_BIRTH.DD_IDTYPE_TEXT.FA_NAME.ADDRESS_1.BRANCHCODE.AdrIssDate.INTRODUCER_TITLE .equals("") && isValid.IS_NOTIMPOR T.is_finge r.L H_IRRIGATION.STATUS.'"+recordSt ring[13]+"'.DD_RELCODE_TEXT.finger_2.OCCUPATION_CODE.equals("NO") ){ wrongFormatRecords++.hhtimphis_kid.AGE.'"+recordString[14]+"'.LAST_UPDATED_DATE.

'" + ""+recordString[22]+"'. wrongFormatRecords++.'"+ ""+recordString[81]+"'.db_Insert(sql).'" + ""+recordString[40]+"'.'"+recordString[48]+"'.'"+recordString[53]+"'.'" + ""+recordString[34]+"'.'" + ""+recordString[70]+"'.'"+recordString[27]+"'.'"+recordSt ring[73]+"'.'" + ""+recordString[75]+"'.'"+recordString[47]+"'.'"+recordString[21]+"'."+null+".'"+recordString[60]+"'.'" + ""+recordString[58]+"'.'"+recordString[20]+"'.'" + ""+recordString[28]+"'.'"+recordString[56]+"'.'"+recordString[54]+"'.'"+recordString[63]+"'.'"+recordString[35]+"'." +null+"."+null+".'"+recordString[41]+"'.'"+recordString[18]+"'.'Y'.'"+recordString[32]+"'.'"+recordString[24]+"'.'"+recordSt ring[37]+"'.'"+recordSt ring[55]+"'.'"+recordString[45]+"'.'"+recordString[79]+"'.'"+recordString[57]+"'."+null+".'"+recordString[65]+"'."+null+".'"+recordSt ring[31]+"'.'"+recordSt ring[61]+"'.'" + ""+recordString[46]+"'.'"+recordString[77]+"'.'"+recordSt ring[25]+"'.'"+recordString[62]+"'.getConnectionDB()).'"+hhtImpHisKid+"'.prepareStatement("update s_HHTnotimp set photo=? where CustomerId='"+recordString[0]+"' and is_notImport='Y' and is_photo='Y' ") ."+ null+".'"+recordString[72]+"'."+null+".'"+docPhtFlag+"'.prepareStatement("update s_HHTnotimp set doc_phot ."+null+".'"+recordString[69]+"'.'"+recordString[42]+"'.'"+recordString[51]+"'."+null+". } if(docPhtFlag.'"+recordSt ring[43]+"'.'" + ""+recordString[52]+"'.'"+recordString[71]+"'.out.close().'"+phtFlag+"'.'"+recordString[66]+"'.'"+recordString[38]+"'."+null+".'"+recordSt ring[49]+"'.""+recordString[16]+"'."+null+".'"+recordString[68]+"'.'"+recordString[26]+"'. pstmt.'"+recordString[29]+"'.'"+recordSt ring[78]+"'."+null+".'"+recordSt ring[19]+"'.getConnectionDB()).'"+fingerFlag+ "'.'"+recordString[59]+"'.'"+recordString[80]+"'. if(phtFlag.equals("Y")){ pstmt = (db.println(sql).'"+recordString[39]+"'.phtBytes).execute(). pstmt.'"+recordSt ring[67]+"'.'"+recordString[74]+"'.'"+sDate+"')".'"+recordString[17]+"'.'" + ""+recordString[64]+"'.'"+recordString[50]+"'.'"+recordString[44]+"'. System.'"+recordString[36]+"'.setBytes(1.'"+recordString[33]+"'.'"+recordString[76]+"'. pstmt.equals("Y")){ pstmt = (db.'"+recordString[30]+"'. db.'"+recordString[23]+"'.

size().NOMINEE_RELATION_CODE.GUARDIAN_CODE.fingerid++.finger_2=?.close().finger_8=?.DD_ CTITLE_TEXT.fingerid<fingerArr.finger_5=?.fingerid<10." + " NOMINEE_NAME.prepareStatement("update s_HHTnotimp set finger_1 =?.DD_STATE_TEXT.get(fingerid)!=null ? Base64.OCCUPATION_CODE.){ pstmt.NOMINEE_FH_NAME.finger_4=?. pstmt. } for(.close(). int fingerid=0.finger_10=?" + " where CustomerId='"+recordString[0]+"' and is_notImport='Y' and is_finger='Y' ").FA_NAME. pstmt." + .INTRODUCER_TITL E." + " INTRODUCER_NAME.o=? where CustomerId='"+recordString[0]+"' and is_notImport='Y' and is_docphoto= 'Y'").CUSTOMER_NAME.pstmtIndex++){ pstmt." + " CUSTOMER_SEX. } pstmt.DD_OC CUPATION_TEXT.setBytes(1. } } */ else if(insertAlready.execute(). VILLAGE_ENAME.STATUS.DD_RELCODE_TEXT.COMMUNITY.decode(fingerA rr.docPhtBytes).DATE_OF_BIRTH. } if(fingerFlag.DD_COMMUNITY_TEXT.GUARDIAN_NAME.DD_ITITLE_TEXT." + " finger_6=?.ADDRESS_1. pstmt.equals("YES")){ String sql="insert into s_HHTInsert( CustomerId.get(fingerid)):null).finger_9=?. pstmt.setBytes(pstmtIndex.AccountNumber.DD_CSEX_TEXT.setBytes(++fingerid.equals("Y")){ pstmt = (db.finger_7=?.NOMINEE_DOB." + " VILLAGE_CODE.DD_GUARDIAN_TEXT .execute(). for(int pstmtIndex=1.fingerArr.equals("") && isValid.null).DD_CITY_TEXT.getConnectionDB()).LAST_UPDATED_DATE.finger_3=?.CUSTOMER_TITLE.PINCODE.

'"+recordSt ring[7]+"'.'"+recordSt ring[55]+"'.'"+recordString[20]+"'.'"+recordSt ring[49]+"'.'"+recordString[12]+"'.CLASS.ADRCERCODE.ADRDOCNO.IS_IMPORT.'" + ""+recordString[22]+"'.'"+recordString[33]+"'.'" + ""+recordString[10]+"'.'" + ""+recordString[70]+"'.'"+recordString[27]+"'.hhtimphis_kid.CustNature.finger_10." + " DD_CATEGORY_TEXT.SPOUSE_NAME.MARITAL_STATUS_CODE.NET_INCOME.'"+recordString[54]+"'.'"+recordString[6] +"'.CATEGORY_CODE.'" +recordString[8]+"'.GROSS_INCOME.DD_IDTYPE_TEXT.'"+recordString[62]+"'.LH_C ITY.'" + ""+recordString[34]+"'.'"+recordString[68]+"'.UID_NUMBER.'"+recordString[38]+"'.'"+hhtImpHisKi .NomSex. '"+recordString[9]+"'.'"+recordString[29]+"'.'"+recordSt ring[25]+"'.LH_RES_OWNER.EDUCATION.'" + ""+recordString[16]+"'.'"+recordString[63]+"'." + " LH_ENCUMBRANCE.Doc_photo.'"+recordString[11]+"'.AdrDocIssPlace.'"+recordString[66]+"'.'"+recordString[59]+"'.UID_ISSUE_DATE.'"+recordString[15]+"'.is_finger.DD_MARITAL_STA TUS.'"+recordSt ring[67]+"'.'"+recordString[51]+"'.CITY_CODE.'"+recordString[45]+"'.'"+recordString[2]+"'.Adr DocIssuAuth.'"+recordString[42]+"'." MO_NAME.LH_SURVEY_NUM.'"+recordString[14]+"'.'"+recordString[32]+"'.LH_STATE.HUSBAND_NAME.'"+recordString[50]+"'.'"+recordString[57]+"'.'"+recordString[48]+"'.NAREGA _NO.finger_4.'"+recordString[47]+"'.'"+recordSt ring[43]+"'.'"+recordString[30]+"'.'"+recordString[26]+"'.finger_3.LH_IRRIGATION .photo.'"+recordString[17]+"'.SPOUSE_OCC UPATION.finger _9.finger_8.'" + ""+recordString[28]+"'.'"+recordString[53]+"'.'"+recordString[18]+"'." + " AdrIssDate.finger_2.LH_COUNTRY.'"+recordString[72]+"'.'" + ""+recordString[4] +"'.'"+recordSt ring[31]+"'.GLCODE.'"+phtFlag+"'.LH_PANCHAYAT.'"+recordString[23]+"'.imp_date) " + " values ( '"+recordString[0]+"'.'" + ""+recordString[52]+"'.'" + ""+recordString[64]+"'.finger_7.'"+recordString[69]+"'." + " PAN_NUMBER.'"+fingerFlag+"'.is_docphoto.LH_DISTRICT.'"+recordString[24]+"'.'" + ""+recordString[46]+"'.HABCODE.'"+recordString[1]+"'.'"+recordString[36]+"'.STATE_CODE.'" +recordString[3]+"'.is_photo.'"+recordString[35]+"'.'"+recordString[74]+"'.PENSIONID.'"+recordString[56]+"'.'"+recordString[44]+"'.'Y'.AGE.'"+recordString[71]+"'.'"+recordSt ring[61]+"'.'"+recordString[21]+"'.AdrExpDate.LH_BLOCK.LH_SOURCE_IRRIGATION.finger_5.'"+recordString[39]+"'.'"+recordString[60]+"'.CASTE.'" + ""+recordString[40]+"'.'"+recordString[5] +"'.'"+recordSt ring[73]+"'.'"+recordSt ring[37]+"'.'"+recordString[41]+"'.BRANCHCODE.IDNUMBER.IDTYPE_CODE.finger_6.LH_TITLE_NAME.'"+recordSt ring[19]+"'.'"+recordString[65]+"'.'" + ""+recordString[58]+"'." + " LH_VILLAGE.LH_LAND_AREA.'"+recordSt ring[13]+"'.RELIGION." + " finger_1.

'" + ""+recordString[75]+"'.db_Insert(sql)." +null+".close().){ .finger_7=?.setBytes(1. System.finger_9=?." +null+". pstmt. int fingerid=0.prepareStatement("update s_HHTInsert set doc_phot o=? where CustomerId='"+recordString[0]+"' and is_Import='Y' and is_docphoto='Y' "). } for(.getConnectionDB())."+null+".pstmtIndex++){ pstmt.finger_8=?.getConnectionDB()).get(fingerid)):null).finger_2=?.equals("Y")){ pstmt = (db. } if(fingerFlag.'"+recordString[79]+"'. pstmt.fingerArr." + " finger_6=?."+null+"." +null+".execute().docPhtBytes)."+null+".fingerid<fingerArr. pstmt.execute(). } if(docPhtFlag.fingerid<10. if(phtFlag."+null+". pstmt.println(sql).setBytes(pstmtIndex.prepareStatement("update s_HHTInsert set finger_1 =?.prepareStatement("update s_HHTInsert set photo=? where CustomerId='"+recordString[0]+"' and is_Import='Y' and is_photo='Y' ")."+null+".'"+ ""+recordString[81]+"'. for(int pstmtIndex=1.d+"'.out.equals("Y")){ pstmt = (db.fingerid++. pstmt.decode(fingerA rr.'"+recordSt ring[78]+"'.'"+recordString[80]+"'."+null+".'"+docPhtFlag+"'.setBytes(1.close()."+null+"."+null+".finger_3=?.size().finger_10=?" + " where CustomerId='"+recordString[0]+"' and is_Import='Y' and is_finger='Y' "). db.finger_5=?.'"+recordString[77]+"'.finger_4=?.getConnectionDB()). pstmt.phtBytes).equals("Y")){ pstmt = (db."+null+".'"+recordString[76]+"'.get(fingerid)!=null ? Base64.'"+sDate+" ')".

put("Format". printStreamLog. wrongFormatRecords++. } }//End of ReadLi ne While Loop } } } if(txtFileExist.println(mainFileName+":. } } else{ printStreamLog.pstmt.Folder "+dirNm+" Customer Id Folder txt file Not Found "). pstmt. wrongFormatRecords++.println(" CustID in .null).println("In "+mai nFileName+":.println("------------------------------------------------------------------------").println("Data already exist In s_hhtinsert table for customerid : ."+recordString[0]).txt File "+recordString[0]+" and CustID in the name of folder "+dirNm+"are not Same").equalsIgnoreCase("Thumbs.Folder "+dirNm+" Customer Id Folder txt file Format Is Wrong "). } } else if(!insertAlready.setBytes(++fingerid. printStreamLog. } pstmt. savedDataInfo.equals("NO") && !dirNm.println("------------------------------------------------------------------------").t rim().equals("")){ printStreamLog.db")){ printStreamLog. duplicateRecords++. return savedDataInfo. } .execute()."InCorrect"). printStreamLog.println("------------------------------------------------------------------------").close(). } } else{ printStreamLog.

//4 Mandatory vaildationArrayList. //0 Mandatory vaildationArrayList. ArrayList <String>vaildationArrayList=new ArrayList<String>().println("------------------------------------------------------------------------"). printStreamLog.add("10! CUSTOMER_TITLE_TEXT ").add("40! COMMUNITY_TEXT "). //5 Mandatory vaildationArrayList."+ e. totalCount). printStreamLog.println("------------------------------------------------------------------------"). wrongFormatRecords=totalCount. savedDataInfo.String sDate.println("Total no of Record :.put("wrongFormatRecords".println("In "+mainFileName+":.put("duplicateRecords".add("6! CUSTOMER_TITLE "). wrongFormatRecords=0.add("16! Acc No "). //2 vaildationArrayList.String geodesicDataType) throws Excepti on{ String isValid="YES".printStackTrace(). //7 Mandatory vaildationArrayList. duplicateRecords). wrongFormatRecords).put("savedDataInfo". //3 vaildationArrayList. } } catch(Exception e){ printStreamLog.add("6! CUSTOMER_SEX_TEXT ")."DataNotFound").println("Total no of Record which Data Format is Wrong :.DataBaseC lass db.split("!")."+wrongFormatRecords). return savedDataInfo. .println("-----------------------RollBack The Data----------------------------------"). savedDataInfo.String bankName.add("1! CUSTOMER_SEX "). String[] recordString = stringReadLine. printStreamLog. savedDataInfo.add("10! DATE_OF_BIRTH ").println(" Error is :. duplicateRecords=0.getMessage()). vaildationArrayList. printStreamLog.Fo lder Data Not Found For Import ")."+totalCount). savedDataInfo."saveSuccess"). savedDataInfo. printStreamLog.println("Total no of Duplicate record :. //6 Mandatory vaildationArrayList. return savedDataInfo.put("Format". savedDataInfo.put("savedDataInfo". String bankCode.} } else{ printStreamLog.add("9! CustomerID "). //1 Mandatory vaildationArrayList."successFailure").add("50! CUSTOMER_NAME "). } printStreamLog." +dupli cateRecords).put("totalCount".add("40! COMMUNITY "). return savedDataInfo. e. //8 vaildationArrayList. } public String isRecordValid(String stringReadLine.

//27 vaildationArrayList.add("20! Mandatory vaildationArrayList. Mandatory vaildationArrayList. //26 vaildationArrayList. vaildationArrayList.add("40! IDNUMBER "). vaildationArrayList.add("50! Mandatory vaildationArrayList.add("50! MOTHER_NAME "). MARITAL_STATUS ").add("40! INTRODUCER_TITLE_TEXT "). //18 //19 //20 vaildationArrayList.add("40! CUSTOMER_ADDRESS ").add("10! Mandatory vaildationArrayList.add("10! NOMINEE_DOB ").add("50! MARITAL_STATUS_CODE ").add("50! FATHER_NAME "). vaildationArrayList. Mandatory vaildationArrayList.add("10! INTRODUCER_TITLE ").add("10! LAST_UPDATED_DATE "). //17 vaildationArrayList.add("40! Mandatory vaildationArrayList.add("10! IDTYPE_CODE "). GUARDIAN_CODE "). //28 //29 //30 vaildationArrayList.add("50! GUARDIAN_TEXT "). CITY_TEXT ").add("40! NOMINEE_NAME ").add("40! NOMINEE_Father/Husband_NAME "). //21 //22 //23 vaildationArrayList. CATEGORY_TEXT "). //24 vaildationArrayList. PINCODE Length "). //25 vaildationArrayList. vaildationArrayList. //31 vaildationArrayList. Mandatory vaildationArrayList.add("40! IDTYPE_TEXT ").add("10! OCCUPATION_CODE ").add("50! OCCUPATION_TEXT "). .add("10! VILLAGE_CODE ").add("30! STATUS ").add("40! NOMINEE_RELATION_CODE ").add("50! GUARDIAN_NAME ").add("40! VillAGE_NAME ").add("40! INTRODUCER_NAME "). Mandatory vaildationArrayList. vaildationArrayList.//9 //10 //11 //12 //13 //14 //15 //16 vaildationArrayList.add("20! Mandatory vaildationArrayList. //32 //33 //34 //35 //36 //37 //38 vaildationArrayList. STATE_TEXT ").add("10! Mandatory vaildationArrayList.add("6! Mandatory vaildationArrayList. Mandatory vaildationArrayList. CATEGORY_CODE ").add("50! NOMINEE_RELCODE_TEXT "). vaildationArrayList. Mandatory vaildationArrayList.

//63 vaildationArrayList. //45 vaildationArrayList. //47 vaildationArrayList.add("40! SPOUSE_NAME ").add("40! NET_INCOME ").add("40! SPOUSE_OCCUPATION ").add("40! LANDHOLDINGS_BLOCK ").add("40! LANDHOLDINGS_SOURCE_IRRIGATION ").add("10! PAN_NUMBER "). //61 vaildationArrayList. //65 vaildationArrayList.add("40! LANDHOLDINGS_VILLAGE ").add("40! CLASS "). //44 vaildationArrayList.add("40! LANDHOLDINGS_LAND_AREA ").add("40! LANDHOLDINGS_IRRIGATION ").add("40! LANDHOLDINGS_SURVEY_NUM ").add("40! LANDHOLDINGS_TITLE_NAME "). Mandatory vaildationArrayList. //52 vaildationArrayList. //53 vaildationArrayList.add("40! EDUCATION ").add("40! LANDHOLDINGS_COUNTRY ").add("40! LANDHOLDINGS_DISTRICT ").add("40! LANDHOLDINGS_ENCUMBRANCE ").add("40! GROSS_INCOME ").add("40! CASTE ").add("10! UID_ISSUE_DATE ").add("10! CITYCODE "). //43 vaildationArrayList.add("40! LANDHOLDINGS_RES_OWNER "). //57 vaildationArrayList.add("40! LANDHOLDINGS_STATE "). //49 vaildationArrayList. //41 vaildationArrayList.add("40! UID_NUMBER "). //50 vaildationArrayList. //40 vaildationArrayList. //66 //67 //68 vaildationArrayList.//39 vaildationArrayList. //56 vaildationArrayList. //59 vaildationArrayList. //60 vaildationArrayList. //55 vaildationArrayList. //64 vaildationArrayList. . //58 vaildationArrayList.add("45! HUSBAND/WIFE_NAME ").add("40! LANDHOLDINGS_CITY ").add("40! RELIGION "). Mandatory vaildationArrayList.add("1! Nominee Gender "). //51 vaildationArrayList. //54 vaildationArrayList.add("20! BRANCHCODE ").add("40! LANDHOLDINGS_PANCHAYAT "). //62 vaildationArrayList.add("10! STATECODE "). //42 vaildationArrayList. //48 vaildationArrayList. //46 vaildationArrayList.

recordString[i] =recordString[i]. i < recordString.parseInt(sDate.add("10! Mandatory vaildationArrayList. Address Doc Issuing Authority "). if(i==7 && recordString[i].add("22! Mandatory Only For SBH (EBT) vaildationArrayList.equals("004")) && ( i==78 || i==76)){ .replace("-".equals("NA") && !reco rdString[79].add("10! Mandatory vaildationArrayList.s ubstring(0.equals("NA")){ recordString[i]=Integer. vaildationArrayList.get(i).add("40! Mandatory vaildationArrayList. Lenth Of thar Record is :-"+recordString.length).length. return "wrongFormat". //81 if(recordString. Address Doc Issue Place ").println("------------------------------------------------------------------------"). Age ").add("10! Customer Nature_Code ").split("!"). } else { for (int i = 0.add("10! Mandatory vaildationArrayList.add("25! Mandatory Only For SBH vaildationArrayList.equals("NA") && !rec ordString[7].add("22! Mandatory Only For SBH vaildationArrayList. NREGA Number "). Address Certification Code "). Address Expiry Date ").length<83){ printStreamLog.equalsIgnoreCase(" State Bank of Hyderabad" )|| bankCode.parseInt(recordString[7].substring(4. Address Issuing Date ").4))-Integer.equals("")){ recordString[i]="01011900". i++) { String validationString[]=null."").add("2! Mandatory vaildationArrayList.equals("")||rec ordString[i]==null?"NA":recordString[i].add("3! Mandatory vaildationArrayList.add("25! Address Document Number "). printStreamLog. Pension ID ").//69 //70 //71 //72 //73 //74 //75 //76 //77 //78 //79 //80 Mandatory vaildationArrayList.toString().add("40! Mandatory vaildationArrayList. if( (bankName.8))+ "". HabCode ").println(recordString[0]+"Customer Id Reco rd Is not In Proper Format. GL Code "). } if(i==79 && recordString[i]. } if(i<82){ // Blank Validation if( i==0 || i==1 || i==5 || i== 4 || i==6 || i==7 || i==10 || i==11 || i==13 || i==14 || i==15 || i==19 || i==22 || i==29 || i==33 || i==34 || i==36 || i==37 || i==38 || i==67 || i==68 || i==69 || i==70 || i==71 || i==72 || i==73 || i==74 || i==75 || i==76 || i==79 || i==78 ){ validationString=vaildationArray List.

isValid="NO".equa lsIgnoreCase("Existing") && i==76 && recordString[i].p rintln(recordString[0]+":-"+validationString[1]+"Value Can't Blank ").p rintln(recordString[0]+":-"+validationString[1]+"Value Can't Blank "). } } if(!(i==76 || i==78 )){ if(recordString[i]. printStreamLog. } } //Customer Sex Validate if(i==5 && (recordString[i].println(" -------------------------------------------------------------------------").equal s("NA") || recordString[i]==null ){ printStreamLog.equals("'M'") || !recordString[i].equals("'M'") || !recordString[i]. } if(recordString[i].p rintln(recordString[0]+":-"+validationString[1]+"Value Can't Blank "). } //Marital Status Validate if(i==36 && (recordString[i].equals("'F'")) ) ){ printStreamLog.equal s("NA") || recordString[i]==null ){ printStreamLog.println(r ecordString[0]+":-"+validationString[1]+"Not In Proper Format :-{ "+recordString [i]+" }").p rintln("------------------------------------------------------------------------").println(r ecordString[0]+":-"+validationString[1]+"Not In Proper Format :-{ "+recordString [i]+" }").println(r ecordString[0]+":-"+validationString[1]+"Not In Proper Format :-{ "+recordString [i]+" }"). isValid="NO". printStreamLog.equals("NA") || recordStrin g[i]==null){ printStreamLog. isValid="NO".equals("'M'") || !recordString[i]. printStreamLog.equals("'F'")) )) { printStreamLog.leng th()>3 && ( !recordString[i].p rintln("------------------------------------------------------------------------").len gth()>3 && ( !recordString[i].len gth()>3 && ( !recordString[i]. .if(geodesicDataType. isValid="NO". isValid="NO". printStreamLog. } //Nominee Gender Validate if(i==69 && (recordString[i].p rintln("------------------------------------------------------------------------").println(" -------------------------------------------------------------------------"). printStreamLog.equals("'S'")) ) ){ printStreamLog.

db_select(" select distinct brn_kid from s_brn where brn_brcod='"+recordString[i]+"' ").println(" -------------------------------------------------------------------------").next()) { ocpID=rs . } } // check that Village code is Ex ist Or Not In DaTaBase if(i==12){ String villageKid="0".next()){ brcode=rs. while(rs. printStreamLog.db_select( " Select ocp_kid from s_ocp where ocp_code='0"+recordString[i]+"' ").p rintln("------------------------------------------------------------------------"). // Check that Occupation is Exis t OR Not In Database if(i==29){ String ocpID="0". while(rs. } } if(ocpID.equals("0")){ rs=db.next()){ ocpID=rs.getStr ing(1). } } // Check That Branch Code Is Exi st Or not In DataBase if(i==68){ String brcode="0". printStreamLog. } if(brcode. rs=db.p rintln("------------------------------------------------------------------------").getString(1).getStri ng(1).p rintln(recordString[0]+":-"+validationString[1]+" Not Exist In DataBase :-{ "+re cordString[i]+" }").db_select(" Select ocp_kid from s_ocp where ocp_code='"+recordString[i]+"' "). isValid="NO". isValid="NO". isValid="NO". . } ResultSet rs=null.equals("0")){ printStreamLog. } if(ocpID.p rintln(recordString[0]+":-"+validationString[1]+" Not Exist In DataBase :-{ "+re cordString[i]+" }").printStreamLog.equals("0")){ printStreamLog. while(rs. rs=db.

p rintln(recordString[0]+":-"+validationString[1]+" Not Exist In DataBase :-{ "+re cordString[i]+" }"). rs=db.next()) { custNatu re=rs. while(rs.getString(1).rs=db.db_select( " Select distinct con_kid from s_con where con_ename='GENERAL' and con_type='S'" ).next()) { custNatu re=rs.ge tString(1). } if(custNature. } if(villageKid.next()){ villageKid=rs. while(rs. printStreamLog.db_select(" Select distinct con_kid from s_con where con_code='"+recordString[i]+"' and con_type=' S'" ). while(rs.next()){ custNature=rs. while(rs. } } // Check that Customer Nature is Exist OR Not In Database if(i==70){ String custNature="0". isValid="NO".equals("0" )){ printStreamLog.equals("0" )){ rs=db. printStreamLog. } } if(custNature.db_select("select distinct village_kid from s_village where village_code='"+recordString[i]+"' and village_brcode='"+recordString[68]+"' ").p rintln("------------------------------------------------------------------------").getString(1).ge tString(1).equals("0" )){ rs=db.p rintln(recordString[0]+":-"+validationString[1]+" Not Exist In DataBase :-{ "+re cordString[i]+" }").db_select( " Select distinct con_kid from s_con where con_code='0"+recordString[i]+"' and c on_type='S'" ). } } if(custNature.p rintln("------------------------------------------------------------------------ .equals("0" )){ printStreamLog.

get (i).parseInt(validationString[0])-1)){ printStreamLog.trim().length()<In teger. while(rs.println(recordStr ing[0]+":-"+validationString[1]+"Length Should Be Less Than "+ validationString [0]+":-{ "+recordString[i]+" }"). } rs=db. } } if(i==38){ String catID="0".println("------------------------------------------------------------------------"). } else if(i==1 && recordString[i]. } } } //Length Validation validationString=vaildationArrayList.l ength()>Integer.println("-------- .length ()>8){ recordString[i]= "6".getStri ng(1). substring(0.equals("0")){ printStreamLog. isValid="NO".split("!").lengt h()>Integer.lengt h()> 40 ){ recordString[i]=recordString[i].p rintln("------------------------------------------------------------------------"). if(pensionId. } if(catID.length()<=8 ){ recordString[i]= "50". } else if(pensionId. 38).toString(). isValid="NO".println(recordStr ing[0]+":-"+validationString[1]+"Length Should Be Less Than OR Equal To "+ valid ationString[0]+":-{ "+recordString[i]+" }").trim().next()){ catID=rs. if(i==10 && recordString[i].trim().p rintln(recordString[0]+":-"+validationString[1]+" Not Exist In DataBase :-{ "+re cordString[i]+" }"). } if(i==0 && (recordString[i].db_select(" Select distinct cat_kid from s_cat where cat_code='"+recordString[i]+"' " ). printStreamLog.trim(). printStreamLog. isValid="NO". printStreamLog.-").parseInt(validationString[0]) || recordString[i].parseInt(validationString[0])){ printStreamLog.

printStreamLog. printStreamLog.p rintln(recordString[0]+":.t<=arr.parseInt(recordString[79])>99){ printStreamLog.println(recordStr ing[0]+":-"+validationString[1]+"Length Should Be Less Than OR Equal To "+ valid ationString[0]+":-{ "+recordString[i]+" }").p rintln("------------------------------------------------------------------------").Customer Age Should Be Less Than 99 "+":-{ "+recordSt ring[79]+" }"). isValid="NO". } else if( recordString[i]. isValid="NO". break.t++) { if(!(arr[t]>='0' && arr[ t]<='9')) { printStreamLog.p rintln("-----------------------------------------------------------------------------------"). isValid="NO". int dateSubStringMonths=0. } } if(i==7 || i==22 || i==73 || i= =74){ . break.println("------------------------------------------------------------------------").p rintln(recordString[0]+":-"+validationString[1]+" Value Should Be Numeric "+":-{ "+recordString[i]+" }").println("------------------------------------------------------------------------").parseInt(validationString[0])){ printStreamLog. } else if(i==1 && recordString[i]. validationString=vaildationArray List.toString(). char arr[]=recordString[i].println(recordStr ing[0]+":-"+validationString[1]+"Length Should Be Greator Than 13 OR Equal To "+ validationString[0]+":-{ "+recordString[i]+" }").get(i).-----------------------------------------------------------------"). isValid="NO". printStreamLog.length-1. } else if(i==79 && Integer .toCha rArray(). int dateSubStringVal=0. } //Numeric Validation if(i==0 || i==15 || i==7 || i==22 || i== 33 || i==73 || i==74 || i==79){ int dateSubStringDays=0. isValid="NO".length()>Intege r.split("!"). printStreamLog.length() <14){ printStreamLog. for(int t=0.

println(recordString[0]+":.village_statid. dateSubStringVal =Integer. printStr eamLog.4))-dateSubStringVal.equals("004")) ){ . String distId="0".village_distid.if(recordString[i]. village_panchytid are Exist Or Not In DaTaBase on the basis of village_code ResultSet rs1=null.parseInt(recordString[i]. } else{ dateSubStringDay s=Integer.Nominee Age Should Be Less Than 99 "+":-{ "+a geFromDOB+" }").p rintln("------------------------------------------------------------------------").2)). String stateId="0".parseInt(recordString[i]. String cntvillmapkid="".substring(0. isValid="NO".println("------------------------------------------------------------------------"). isValid= "NO".p rintln(recordString[i]). if(dateSubString Months>12 || dateSubStringMonths==0 || dateSubStringDays>31 || dateSubStringDays ==0 || dateSubStringVal<1900){ printStr eamLog.substring(0. String panchayatId="0". printStreamLog.length()>8){ printStreamLog. dateSubStringMon ths=Integer.substring(2. isValid= "NO".8)). } if(i==22 && ageF romDOB>99){ printStr eamLog. } } } } } }//End of FOR loop // check that village_kid.println("------------------------------------------------------------------------").println(recordString[0]+":-"+validationString[1]+" Format Is Wrong "+":-{ "+recordString[i]+" }"). if( (bankName. int ageFromDOB=I nteger. printStr eamLog.p rintln(recordString[0]+":-"+validationString[1]+" Format Is Wrong "+":-{ "+recor dString[i]+" }").parseInt(recordString[i].equalsIgnoreCase("State Bank of Hyderabad" )|| bankCode. printStreamLog.substring(4. String villageKid="0".lengt h()<8 || recordString[i].parseInt(sDate.4)).

equals("0") || stat eId.getString(8).getString(12).i snull(dist_kid.String bankCode. sDD_COMMUNITY_TEXT=rs. distId=rs1.'0'). printStreamLog.trim(). sCOMMUNITY=rs.'0') from scntvill mapkid where village_code='"+recordString[12]+"' and village_brcode='"+recordStr ing[68]+"' ".getString(3).isnull(panchayat_kid.println("HabCode code is :. Panchayat is Not Exist In DataBase On The Basis Of Vill age and Brancode OR HabCode{In case of SBH}" ).cntvillmapkid=" select isnull(village_kid.getString(2).getString(9).Date sDate. sDD_CITY_TEXT=rs.'0'). State .getString(4).Object> hashMap=new HashMap<String.trim().Object> InsertDataInMainTables(DataBaseClass db. sDD_CSEX_TEXT=rs.trim(). isValid="NO".getString(6). sCUSTOMER_TITLE=rs.String hhtImpHisKid.equals("0")){ printStreamLog. while(rs.getString(5).String geo desicDataType){ HashMap <String.getString(10). panchayatId=rs1.'0').trim(). sCUSTOMER_NAME=rs.ja va. } rs1=db.getString(3). printStreamLog.trim(). } else{ cntvillmapkid=" select isnull(village_kid.i snull(dist_kid.'0'). ResultSet rs=db. printStreamLog. District .db_select(cntvillmapkid).Villa ge .next()){ sCUSTOMER_ID=rs.'0')." + recordString[68]).next()){ villageKid=rs1.Object>().isnull(stat_kid.trim().trim().getString(4). } public HashMap<String.getString(11).println("Branchcode code is :.println("------------------------------------------------------------------------")." + recordString[12]).'0') from scntvill mapkid where village_brcode='"+recordString[68]+"'and hbt_jbcode='"+recordStrin g[78]+"'".trim().trim().getString(14). sCUSTOMER_SEX=rs. sADDRESS_1=rs. sVillage_Ename=rs.equals("0") || distId.sql.isnull(panchayat_kid.getString(13). sDATE_OF_BIRTH= rs.trim().'0').db_select(sSql).equals("0") || panchayatId.println("Village code is :. while(rs1.isnull(stat_kid.println(recordString[0]+":. try{ String sSql=" Select * from s_HHTInsert where IS_IMPORT is null or IS_IMPORT = 'Y' and is_photo='Y' and is_finger='Y' and hhtimphis_kid= '"+hhtImpHisKid+"' order by tempins_kid ". .getString(15). } if(villageKid.String bankName. sDD_CTITLE_TEXT=rs.trim().getString(7).getString(1).trim().trim().trim(). sACCOUNT_NUMBER=rs. } } return isValid. sVILLAGE_CODE=rs. stateId=rs1. printStreamLog.getString(2)." + recordString[78]).

trim().getString(42). sDD_GUARDIAN_TEXT=rs. sNOMINEE_FH_NAME=rs.trim().trim().trim().getString(17).trim().getString(16).trim(). sLH_DISTRICT=rs.trim().trim().trim().trim().trim().trim().trim().getString(29).getString(72). sNOMINEE_RELATION_CODE=rs.trim().getString(57).trim().getString(69).getString(58).getString(30).getString(61).getString(67). sDD_CATEGORY_TEXT=rs.trim().trim().getString(28). sLH_SURVEY_NUM=rs.trim().getString(60).getString(36). sHUSBAND_NAME=rs.getString(25).getString(37).trim().getString(18).trim().trim().trim().getString(59).getString(63).trim(). sSPOUSE_OCCUPATION=rs.getString(19).getString(48). sSTATUS=rs.getString(26).trim().trim(). sLH_TITLE_NAME=rs.trim(). sUID_ISSUE_DATE=rs.trim().getString(24). sNOMINEE_NAME=rs. sLH_STATE=rs. sPAN_NUMBER=rs. addrDocIssuAuth=rs.trim(). sGROSS_INCOME=rs.trim().getString(44).getString(66). sINTRODUCER_TITLE=rs. addrDocIssuPlace=rs.getString(47). sCLASS=rs.getString(70). sGUARDIAN_CODE=rs.getString(75).getString(21). cityCode=rs.getString(56). sDD_MARITAL_STATUS=rs. sSPOUSE_NAME=rs. sLH_ENCUMBRANCE=rs.trim().trim().trim().getString(20).trim().getString(73). sMO_NAME=rs. sEDUCATION=rs.trim().getString(27). sLAST_UPDATED_DATE=rs.getString(35).getString(74).trim().getString(64).trim().getString(50).getString(33). sLH_SOURCE_IRRIGATION=rs.getString(55).getString(68). sUID_NUMBER=rs.getString(40).trim().getString(52). sOCCUPATION_CODE=rs. sLH_BLOCK=rs.trim().trim().trim().getString(76). sFA_NAME=rs.getString(49).sDD_STATE_TEXT=rs.trim(). sNOMINEE_DOB=rs. sDD_IDTYPE_TEXT=rs.trim().getString(62). sGUARDIAN_NAME=rs.trim().trim(). sNET_INCOME=rs. custNatureCode=rs. sDD_ITITLE_TEXT=rs. sLH_VILLAGE=rs. sIDNUMBER=rs.trim().trim(). sLH_RES_OWNER=rs. sLH_PANCHAYAT=rs. sMARITAL_STATUS_CODE=rs. addrIssuDate=rs.getString(46). sDD_RELCODE_TEXT=rs.trim().getString(31). nomGender=rs.trim(). sLH_LAND_AREA=rs. sLH_CITY=rs.getString(32).getString(38).trim(). sRELIGION=rs.trim(). stateCode=rs.getString(34). sCASTE=rs.trim().trim().getString(54).getString(22).getString(45). sBrancode=rs.getString(51). sIDTYPE_CODE=rs.trim().trim().trim().getString(41).getString(53). .trim().getString(65). sINTRODUCER_NAME=rs. sDD_OCCUPATION_TEXT=rs.trim().trim().trim().getString(43).getString(23). sLH_COUNTRY=rs.getString(39).trim(). sCATEGORY_CODE=rs. sLH_IRRIGATION=rs. sPINCODE=rs.

getString(1). habCode=rs. } if(sCUSTOMER_SEX. } if(sGROSS_INCOME. } } if(sNET_INCOME. adrCerCode=rs. if(!sGUARDIAN_CODE. } ResultSet resultSet=null. resultSet=db.equals("M")){ sCUSTOMER_TITLE="MR.getString(81). age=rs.equals("01011900")){ sLAST_UPDATED_DATE=ssDate.getString(86). pensionId=rs. } if(sLAST_UPDATED_DATE.equals ("0")){ // check record on the basis of cust-name.getString(85).addrExpDate=rs.getString(83).getString(2).s_cust. } if(!sNOMINEE_NAME. String checkedCustStatus="".equalsIgnoreCase("State Bank of Hyd erabad" ) || bankCode. if( bankName.getString(87).trim().getString(84).'') FROM s_iac.equals("NA") ){ sNET_INCOME="0".getString(77). } if(checkedCustKid.0) .isnull(cust_status. checkedCustStatu s=resultSet. while(resultSet.s_a cc WHERE acc_custid = cust_kid and cust_kid=iac_custid and iac_dob='"+sDATE_OF_ .equals("NA") ){ sGROSS_INCOME="0". cust-father name.equals("NA")){ if(sCUSTOMER_SEX. String checkedCustKid="0". adrDocNo=rs.equalsIgnore Case("NA")){ fetchQry=" Select isnull (cust_kid. String ssDate=sDate+"". } if(sCUSTOMER_TITLE.trim().". DOB resultSet=db.equals("NA")){ iac_nomyn="Y".equals("004")){ String fetchQry="". String sSqlInsert="".0).equals("NA")){ iac_minor="Y".db_select(f etchQry).equalsIgnoreCase("Fr esh")){ // New Fresh (non EBT) if(pensionId. iac_grdyn="Y". if(geodesicDataType. glCode=rs. naregaNumber=rs. isnull(cust_status.next()){ checkedCustKid=r esultSet.db_ select(" SELECT isnull(cust_kid.'') from s_cust where cust_kid='"+sCUSTOMER_ID+ "' ".".getString(82).equals("F")){ sCUSTOMER_TITLE="MRS.

} if(checkedCustKid.bankCode.getString(1).cust_nregajobcardno.'"+catID+"'. while(resultSet. String sCustKid= "". fetchKidFromMast er(db.equals("0")){ insertDa taIntoAllTables(db.parseInt(sNOMINEE_DOB.cust_nicno.'M'. } } if(!checkedCustKid.'Y'.'.cust_ename. String upSql=" u pdate s_HHTInsert set IS_IMPORT='N' .cust_habit. parseInt(ssDate.cust_nicissdt )" + " values ('"+sCUSTOMER_ID+"'.'"+sCUSTOMER_NAME+"'.4)).getString(1). sNomAge=Integer. db.p rintln(" -----------------------------------------------------------------------").cust_branCode.p rintln( sCUSTOMER_ID+ " : Customer id Is Already Exist "). sSqlInsert=" ins ert into s_cust (cust_kid.equal s("0")){ alreadyUpdate++.sCustKid. checkedC ustStatus=resultSet. db. bankName.db_ select(" select isnull(max(cust_kid).substring(0.'.'"+sCUSTOMER_NAME+"'. geodesic_stat us='Already Exist' where CUSTOMERID='"+sCUSTOMER_ID+"' and IS_IMPORT='Y' ".'"+habCode+" ' .'"+sBrancode+"'.bankCode).trim().4))-Integer.substring(0.cust_segid.cust_hname. } if(!sCustKid.'0') from s_cust where cust_kid='"+sCUSTOME R_ID+"' and cust_isImport='Y'").cust_crdate. next()){ checkedC ustKid=resultSet.'Y'.cust_ef name.db_update(upS ql).cust_oldkid. next()){ sCustKid =resultSet.BIRTH+"' and iac_horfename='"+sFA_NAME+"' and cust_ename='"+sCUSTOMER_NAME+"' an d acc_flag <> 'R' ").cust_isImport. cust_status.'"+naregaNumber+"'.dbRunDDLComma nd("SET IDENTITY_INSERT S_CUST OFF"). '"+segid+"'. .'"+pensionId+"'. db. cust_pensionumber.dbRunDDLComma nd(" SET IDENTITY_INSERT S_CUST ON"). while(resultSet.bankName).equ als("") && !sCustKid. resultSet=db.'"+sLAST_UPDATED_DATE+"'. printStreamLog.is_ExistingOrFresh ='fresh' .'"+sCUSTOMER_ID+"'.'"+sCUS TOMER_TITLE+"'.cust_cat. printStreamLog.getString(2).db_Insert(sSq lInsert).cust_ettl.equals ("0")){ db.cust_type.'"+sUID_ISSUE_DATE+"') ".'"+sUID_NUMBER+"'.

s_acc WHERE acc_custid = cust_kid and cust_kid=iac_custid and iac_dob='"+sDATE_OF_BIRTH+"' and iac_horfename='"+sFA_NAME+"' and cust_ename='"+sCUSTOMER_NAME+"' and acc_fl ag <> 'R' "). checkedCustStatu s=resultSet."".db_select(" SELECT isnull(cust_kid.insertPh oto (db.next()){ checkedCustKid=resultSet . while(resultSet."").println(" -----------------------------------------------------------------------"). printStr eamLog. } /* if(checkedCustKid.getString(1). } } */ if(!checkedCustKid.sCustKid. insertFi nger(db. newInser t++.getString(1).s_cust. String u pSql=" update s_HHTInsert set IS_IMPORT='N' .println(" Customer ID : "+ sCustKid +" Is Fresh Record & Inserted Success Fully "). while(resultSet. . insertDo cPht(db.db_select(fetchQry) ."" ).0). } } } } if(geodesicDataType.sCustKid.'') FROM s_iac.is_ExistingOrFresh ='fresh' ."".sCustKid.next()){ checkedCustKid=r esultSet.db_up date(" update s_cust set cust_isImport='N' where cust_kid ='"+sCUSTOMER_ID+"' AN D cust_isImport='Y'"). count++. DOB resultSet=db. db.equals("0") & & checkedCustStatus.0) .equals("0")){ // check record on the basis of cust-name. checkedCustStatus=result Set.getString(2). resultSet=db. printStreamLog."".""). db. geode sic_status='Insert SuccessFully ' where CUSTOMERID='"+sCUSTOMER_ID+"' and IS_IMP ORT='Y' ".getString(2).'') from s_cust where cust_pensionumber='"+pensionId+"' and cust_habit='"+habCode+"' ".isnull(cust_status.println( sCUSTOMER_ID +" : Customer Id is Already Updated "). isnull(cust_status.equalsIgnoreCase("Y")){ alreadyUpdate++.db_up date(upSql). cust-father name. printStr eamLog.equalsIgnoreCase("Ex isting")){ // EBT fetchQry=" Select isnull(cust_ki d.

checkedC ustKid. updateDataIntoAllTables( db.bankName).pensionId. insertPhoto (db.is_ExistingOrFresh ='Existing' .is_ExistingOrFresh ='Existing' .println(" ------------------------------------------------------------------------").printStreamLog.is_ExistingOrFresh ='Existing' ." +pensionId ). printStreamLog.println(" Customer ID : "+checkedCustKid +" :is Existing Record & Update SuccessFully ").habCode ).println(" Pension Number Is :.println(" ------------------------------------------------------------------------"). printStreamLog.equals("0 ")){ newInsert++.bankName).println(" Hab Code Is :-"+ habCode). String upSql=" update s_ HHTInsert set IS_IMPORT='N' .bankCode.db_update(" update s_ cust set cust_isImport='N' where cust_kid ='"+sCUSTOMER_ID+"' AND cust_isImport ='Y'"). db. geodesic_status='U pdate SuccessFully' where CUSTOMERID='"+sCUSTOMER_ID+"' and IS_IMPORT='Y' ". printStreamLog. printStreamLog. count++. insertDocPht(db. db.equalsIgnoreCase("Y")){ // Update Records Existing (EBT) fetchKidFromMaster(db. } else if(!checkedCustKid. geodesic_status='NI C Data Not Available On Server' where CUSTOMERID='"+sCUSTOMER_ID+"' and IS_IMPOR T='Y' ".db_update(upSql).println(" Customer ID : "+ sCUSTOMER_ID +" is Fresh Record and Not Update"). String upSql="update s_H HTInsert set IS_IMPORT='Y' . printStreamLog.habCode). printStreamLog. insertFinger(db. printStreamLog.db_update(upSql).pensionId. printStreamLog. db. } else if(checkedCustKid. db. } . checkedCustKid .println(" Pension Number Is :.println(" Hab Code Is :-"+ habCode).checkedC ustKid.ba nkCode.equals(" 0") && !checkedCustStatus.println(" Hab Code Is :-"+ habCode).db_update(upSql).println(" Pension Number Is :." +pensionId ). String upSql=" update s_ HHTInsert set IS_IMPORT='N' .pensionId. oldUpdate++." +pensionId ). printStreamLog. printStreamLog.println(" ------------------------------------------------------------------------").checkedC ustKid. geodesic_status='A lready Updated on Server' where CUSTOMERID='"+sCUSTOMER_ID+"' and IS_IMPORT='Y' ".habCode).

'"+sU ID_NUMBER+"'.p rintln(" -----------------------------------------------------------------------").bankCode).cust_crdate.'.cust_type.cust_efname.4)).p rintln(" Customer ID : "+ sCustKid +" Is Fresh Record & Inserted SuccessFully ") . sSqlInsert=" insert into s_cust (cust_kid.sCustKid.trim().cust_habit.db_Insert(sSqlInsert) .'"+habCode+"' .'"+sCUSTOMER_NAME+"'."". count++.'M'.getString(1). cust_st atus.'"+catID+"'.parseInt(sNOMINEE_DOB.db_update(" u pdate s_cust set cust_isImport='N' where cust_kid ='"+sCUSTOMER_ID+"' AND cust_i sImport='Y'").cust_nregajobcardno.'"+sLAST_UPDATED_DATE+"'. resultSet=db./* ")){ // Insert Fresh Record (EBT) IDENTITY_INSERT S_CUST ON"). cu st_pensionumber.'"+sUID_ISSUE_DATE+"') ".equals("") && !sCustKid. } if(!sCustKid."" ).cust_nicno.dbRunDDLCommand("SET IDENTITY_INSERT S_CUST OFF").'"+sBrancode+"'.4))-Integer. newInsert++.'T'.'"+sCUSTOMER_TI TLE+"'. db. while(resultSet."").'"+sCUSTOMER_NAME+"'.'"+sCUSTOMER_ID+"'.bankName).ba nkCode.db_update(upS ql).'"+naregaNumber+"'.substring(0. sCustKid.dbRunDDLCommand(" SET fetchKidFromMaster(db. bankName.""). else if(checkedCustKid.cust_ettl. printStreamLog.cust_cat.'0') from s_cust where cust_oldkid='"+sCUSTOMER_ID+ "' and cust_pensionumber='"+pensionId+"' and cust_habit='"+habCode+"' and cust_ isImport='Y'").cust_segid.next()){ sCustKid=resultS et. sCustKid.cust_nicissdt )" + " values ('"+sCUSTOMER_ID+"'.substring(0.parseInt (ssDate. db.'Y'.cust_hname."". db. String upSql=" u pdate s_HHTInsert set IS_IMPORT='N' where CUSTOMERID='"+sCUSTOMER_ID+"' and IS_I MPORT='Y' ". insertPhoto (db.db_select(" select isnull(max(cust_kid).'"+segid +"'.'.equals("0")){ insertDataIntoAl lTables(db.cust_ename.cust_oldkid.'"+pensionId+"'. String sCustKid=""."". } } */ } } .cust_branCode. insertDocPht(db. printStreamLog. db. sNomAge=Integer. insertFinger(db. sCustKid.cust_isImport.equals("0 db.

println(" Pension Number Is :.isnull(cust_status.equalsIgnoreCase("Y")) { fetchKidFromMaster(db.checkedC ustKid. checkedCustStatu s=resultSet. updateDataIntoAllTables( db.println(" Hab Code Is :-"+ habCode)."". } } if(!checkedCustKid.'') FROM s_iac.bankCode. printStreamLog." +pensionId ).getString(2). isnull(cust_status.0). String upSql="update s_H HTInsert set IS_IMPORT='N' .bankName). geodesic_status='In .'') from s_cust where cust_kid='"+sCUSTO MER_ID+"' ").equals("0")){ resultSet=db. } if(!checkedCustKid.println(" ------------------------------------------------------------------------").s_acc WHERE acc_custid = cust_kid and cust_kid=iac_custid and iac_dob='"+sDATE_OF_BIRTH+"' and iac_horfename='"+sFA_NAME+"' and cust_ename='"+sCUSTOMER_NAME+"' and acc_fl ag <> 'R' ").s_cust.trim(). printStreamLog. insertDocPht(db. printStreamLog.bankName)."". geodesic_status='A lready Updated on Server' where CUSTOMERID='"+sCUSTOMER_ID+"' and IS_IMPORT='Y' ".db_select(" SELECT isnull(cust_kid. insertPhoto (db. checkedCustStatus=result Set. String upSql="update s_H HTInsert set IS_IMPORT='N' .equals("0") & & ! checkedCustStatus.getString(1).trim().checkedC ustKid.checkedC ustKid.getString(2).0) .is_ExistingOrFresh ='Existing' . checkedCustKid .println(" ------------------------------------------------------------------------").equalsIgnoreCase("Ex isting")){ // resultSet=db. while(resultSet. alreadyUpdate++."" ).next()){ checkedCustKid=resultSet .equals("0") & & checkedCustStatus. db.is_ExistingOrFresh ='Existing' . printStreamLog.println(" Customer Id : "+ sCUSTOMER_ID +" is Existing Record & Update SuccessFully ").ba nkCode.getString(1).println( sCUSTOMER_ID +" : Customer id Is Already Updated "). insertFinger(db."".db_update(upSql)."").db_select(" Select isnull(cust_kid.trim()."").trim(). while(resultSet. printStreamLog.equalsIgnoreCase("Y")){ printStreamLog. } if(checkedCustKid.next()){ checkedCustKid=r esultSet.else{ if(geodesicDataType.

getString(1).db_Insert(sSqlInsert) .s_cust.dbRunDDLCommand(" SET IDENTITY_INSERT S_CUST ON").cust_segid. sSqlInsert="insert into s_cust (cust_oldkid. geodesic_status='Alrea dy Exist' where CUSTOMERID='"+sCUSTOMER_ID+"' and IS_IMPORT='Y' ". } } if(!checkedCustKid.'"+sBrancode+"'. printStreamLog. checkedCustStatus=result Set.isnull(cust_status.bankName).sert SuccessFully' where CUSTOMERID='"+sCUSTOMER_ID+"' and IS_IMPORT='Y' ".getString(1).db_update("update s_c ust set cust_isImport='N' where cust_kid ='"+sCUSTOMER_ID+"' AND cust_isImport=' Y'").'"+sCUSTOMER_NAM E+"' .db_select(" SELECT isnull(cust_kid. count++.'"+ca tID+"'. cust_status. alreadyUpdate++.cust_ettl.ba nkCode. db. db.cust_hname.trim().'M'.cust_ename.db_select(" Select isnull(cust_kid.'Y'.db_update(upSql).cust_nicissdt)" + "values ('"+sCUSTOMER_ID+"'.'.next()){ checkedCustKid=r esultSet.trim().equals("0") & & checkedCustStatus. db.cust_type.equalsIgnoreCase("Y")){ printStreamLog.s_acc WHERE acc_custid = cust_kid and cust_kid=iac_custid and iac_dob='"+sDATE_OF_BIRTH+"' and iac_horfename='"+sFA_NAME+"' and cust_ename='"+sCUSTOMER_NAME+"' and acc_fl ag <> 'R' "). String upSql="update s_H HTInsert set IS_IMPORT='N' .getString(2). while(resultSet.cust_isImport.cust_kid. } if(checkedCustKid.cust _nicno. db.'.0).getString(2).'') from s_cust where cust_kid='"+sCUSTO MER_ID+"' "). .cust_efname.'Y'.trim().println( sCUSTOMER_ID +" : Customer id Is Already Exist ").'"+sUID_ISSUE_DATE+"') ". checkedCustStatu s=resultSet. oldUpdate++.is_ExistingOrFresh ='Fresh' .trim().db_update(upSql).equals("0")){ db. while(resultSet.cust_ cat.0) .next()){ checkedCustKid=resultSet . fetchKidFromMaster(db.equalsIgnoreCase("Fr esh")){ // resultSet=db.'"+sUID_NUMBER+"'.'"+sLAST_UPDATED_DATE+"'. } if(checkedCustKid.'') FROM s_iac.equals("0")){ resultSet=db.'"+sCUSTOMER_ID+"' . } } if(geodesicDataType.'"+segid+"'. isnull(cust_status.cust_crdate.println(" ------------------------------------------------------------------------").'"+sCUSTOMER_NAME+"'.cust_branCode.'"+sCUSTOMER_TITLE+"'.

is_ExistingOrFresh ='Fresh' . ++fingerNotAvailCount. while(fingerNotAvailRS.bankCode)."". sCustKid. newInsert++.db_update(upS ql)."").next()){ fingerNotAvailCustid=fingerNotAvailRS.4)). geodesic_statu s='Insert SuccessFully' where CUSTOMERID='"+sCUSTOMER_ID+"' and IS_IMPORT='Y' ". sCustKid.println(fingerNotAvailCustid+" Cu stomer id Finger is not available "). printStreamLog. String phtNotAvailCustid="".substring(0.p rintln(" -----------------------------------------------------------------------"). String upSql="up date s_HHTInsert set IS_IMPORT='N' . printStreamLog. printStreamLog.next()){ sCustKid=rsCustK id. sCustKid. parseInt(ssDate. insertDocPht(db. insertPhoto (db. ResultSet rsCustKid=db."").p rintln( sCustKid +" :Is Fresh Record & Inserted SuccessFully ").4))-Integer. while(rsCustKid."".db_select(sql1).equals("0")){ sNomAge=Integer. count++.equals("") && !sCustKid.getString(1). insertDataIntoAl lTables(db. ResultSet fingerNotAvailRS=db. bankName.println(" -------------------------------------------------------------------------------").db_update("up date s_cust set cust_isImport='N' where cust_kid ='"+sCUSTOMER_ID+"' AND cust_is Import='Y'"). printStreamLog. } String sql1="Select customerid from s_HHTInsert WHERE i s_Photo='N' and hhtimphis_kid='"+hhtImpHisKid+"' order by tempins_kid ". db.substring(0."" ).d b_select("select isnull(max(cust_kid)."".'0') from s_cust where cust_oldkid='"+sCUS TOMER_ID+"' and cust_isImport='Y'").next()){ . ResultSet phtNotAvailRS=db.parseInt(sNOMINEE_DOB.dbRunDDLCommand("SET IDENTITY_INSERT S_CUST OFF"). } } } } } String sql=" Select customerid from s_HHTInsert where is_finger='N' and hhtimphis_kid='"+hhtImpHisKid+"' order by tempins_kid ".getString( 1). String sCustKid="". String fingerNotAvailCustid="". insertFinger(db. while(phtNotAvailRS. db.sCustKid.trim().db.db_select(sql). } if(!sCustKid.

hashMap. count). printStreamLog. hashMap."+ alreadyUpdate). hashMap. hashMap.println(" Total no of records which finger is not Available :. } } catch(Exception e) { printStreamLog. hashMap.println(" -------------------------------------------------------------------------------").put("returnTypeFromMain".println(" "). printStreamLog.put("newInsert". hashMap. 0). hashMap.phtNotAvailCustid=phtNotAvailRS. 0). printStreamLog. printStreamLog. count).printStackTrace().put("alreadyUpdate". hashMap. 0). fingerNotAvailCount). oldUpdate). count).put("alreadyUpdate".println("======================================== ==Operation Completed SuccessFully==================================").println(" ").println(" "). printStreamLog. printStreamLog. printStreamLog. printStreamLog. alreadyUpdate). "failure"). 0). 0). return hashMap.println(" "). hashMap.put("totalPhoto". hashMap. printStreamLog. newInsert).put("totalFingerNot".println(" Total no of Record Which is Old And Upd ated :.println(" ").println("----------------------------------------------").put("oldUpdate".println(" ").put("totalPhoto". ++phtNotAvailCount."+ oldUpdate). 0).put("oldUpdate". printStreamLog.put("totalSavedRecord".println(" Total no of Record which photo is not a vailable :. phtNotAvailCount).getString(1)."+ newInsert). hashMap.getMessage()). printStreamLog.println(" Total no of records saved with photo an d finger are :. hashMap.put("totalFinger".println(" ")."+ e."+ phtNotAvailCount). } hashMap. printStreamLog."+ count). printStreamLog. hashMap.println(" Error is :.put("totalFinger". printStreamLog. . printStreamLog.put("totalSavedRecord". "mainSuccess"). printStreamLog.put("newInsert".put("totalPhotoNot".println("======================================== ===================================================================="). e.println("======================================== ====================================================================").put("returnTypeFromMain".println(" Total no of Record Which is new And Not Inserted :. hashMap.println(phtNotAvailCustid+" Custo mer id Photo is not available "). printStreamLog.println("-----------------------RollBack The Data----------------------------------"). printStreamLog."+ fingerNotAvailCount).println(" Total no of Record Which is Already Upd ated :. hashMap. printStreamLog. printStreamLog.

getString(1).next()){ glKid=rs1.next()){ edukid=rs1. while(rs1.equals("0")){ rs1= db. while(rs1.getString(1). } rs1= db.trim()+"' and con_type='S'") . } public void fetchKidFromMaster(DataBaseClass db .length()>8){ sCATEGORY_CODE="6".next()){ rlgnKid=rs1.getString(1). return hashMap.println(" "). } rs1= db.getString(1).getString(1).getString(1).next()){ custNature=rs1.next()){ custNature=rs1. while(rs1. while(rs1.db_select(" Select distinct(act_kid) from s_act where ac t_code='"+glCode+"' and act_atptype='S' and act_conv='Y'") . } } if(pensionId. } if(custNature.String bankCode. } else if(pensionId.db_select("select distinct con_kid from s_con wh ere con_code='0"+custNatureCode.db_select(" select cst_kid from s_cst where cst_ename='"+ sCLASS+"'"). while(rs1.next()){ classId=rs1.getString(1). while(rs1.equals("0")){ rs1= db. } rs1= db. } if(glKid. } rs1= db. } rs1= db.next()){ glKid=rs1.getString(1).db_select(" Select distinct edu_kid from s_edu where ed u_ename='"+sEDUCATION+"' ") .trim()+"' and con_type='S'") . while(rs1.next()){ cstKid=rs1.db_select(" Select distinct rlgn_kid from s_rlgn where rlgn_ename='"+sRELIGION+"' ") .next()){ catID=rs1. while(rs1.db_select(" Select distinct cst_kid from s_cast where cs t_ename ='"+sCASTE+"' ") .db_select("select distinct act_kid from s_act wh ere act_atptype = 'S' and act_brcode = '0000' and act_conv = 'Y'") .println(" ").db_select(" Select distinct cat_kid from s_cat where cat _code='"+sCATEGORY_CODE+"'" ) .db_select("select distinct con_kid from s_con where con_ code='"+custNatureCode. } rs1=db.length()<=8){ sCATEGORY_CODE="50".printStreamLog.String bankName) throws Exception{ rs1= db. printStreamLog.getString(1). . while(rs1.

next()){ cityID=rs1. } ResultSet rsVillage=db. } rs1 = db.'0').trim(). while(rs1. while(rs1. } if((bankName.next()){ sVillageKid=rsVillage.getString(1).getString(1). } if(ocpID.isnull(di st_kid. } } rs1= db.getString(1).db_select("select distinct con_kid from s_con wh ere con_ename='GENERAL' and con_type='S'") . . } else{ cntvillmapkid=" select isnull(village_kid.equals("0")){ rs1= db.equalsIgnoreCase("State Bank of Hyderabad" )|| bank Code. } rs1=db. while(rs1. while(rs1.trim().next()){ ocpID=rs1.next()) { sDD_CITY_TEXT = rs1.'0') from scntvillmapkid w here village_brcode='"+sBrancode+"'and hbt_jbcode='"+habCode+"'".db_select(" SELECT distinct cnt_kid FROM S_CNT WHERE CNT_ ECNT='INDIA'" ). } rs1= db.'0').equals("004")) ){ cntvillmapkid=" select isnull(village_kid.getString(1).next()){ cntId=rs1.getString(1).'0').next()){ custNature=rs1.getString(1).equals("0")){ rs1= db. while (rsVillage.trim().'0').getString(2).isnull(panchayat_kid.'0').isnull(di st_kid. while (rs1. sPanchayatId=rsVillage.db_select("Select distinct ocp_kid from s_ocp where ocp_ code='"+sOCCUPATION_CODE+"'") . while(rs1.getString(4).trim(). sVillageDistid=rsVillage.isnull(panchayat_kid.isnull(stat_kid.db_select("Select distinct ocp_kid from s_ocp wh ere ocp_code='0"+sOCCUPATION_CODE+"'") .'0'). while (rs1.} } if(custNature.db_select(" Select distinct moo_kid from s_moo where moo _ename='SELF' ") .getString(1).isnull(stat_kid.next()){ sMop=rs1.getString(1).next()){ ocpID=rs1.db_select(cntvillmapkid).'0') from scntvillmapkid w here village_code='"+sVILLAGE_CODE+"' and village_brcode='"+sBrancode+"' ".db_select(" Select distinct brn_cityid from s_brn where brn_brcod='"+sBrancode+"' ") .db_select(" select city_ename from s_city where city_ki d='"+ cityID+ "'"). sVillageStateid=rsVillage. } } rs1= db.getString(3).

getBinaryStream(8). InputStream stream_7=null.String habcode) throws Exception{ String condition="". while(fingerInsert. stream_5 = fingerInsert.isnull(finger_9. InputStream stream_1=null.').getString(1).'). InputStream stream_6=null.getString(1). InputStream stream_8=null.isnull(finger_5. while (rs1. stream_4 = fingerInsert.isnull(finger_7. .next()){ recFinger=checkDupRS. } } public void insertFinger(DataBaseClass db.'.isnull(finger_3.'.isnu ll(finger_8.').next()){ stream_1 = fingerInsert.'.getBinaryStream(7). } String fingerInsertStr=" select isnull(finger_1.db_update("update "+signDB+". stream_7 = fingerInsert. stream_9 = fingerInsert.} rs1=db.'.getBinaryStream(5). InputStream stream_2=null.getBinaryStream(1).. stream_3 = fingerInsert.'.db_select(" select distinct seg_kid from s_seg where seg_ ename='other' " ).').') " + " from s_hhtinsert where is_finger='Y' and "+c ondition+" ".equals("0")){ db.db_select(fingerInsertStr). String checkDupFinger="select count(*) from "+signDB+". } else{ condition=" CustomerId='"+sCustKid+"'".String pensio nid. stream_2 = fingerInsert.String sCustKid ..'.getBinaryStream(9). InputStream stream_3=null.getBinaryStream(3).'). stream_10 =fingerInsert.'.getBinaryStream(6).isnull(finger_10. InputStream stream_10=null. InputStream stream_4=null.db_select(checkDupFinger). String recFinger="0". stream_8 = fingerInsert.getBinaryStream(4). if(!pensionid.getBinaryStream(2).equals("") ){ condition=" PENSIONID='"+pensionid+"' and HABCODE='"+hab code+"' ". checkDupRS=db. while(checkDupRS. InputStream stream_5=null. } ResultSet checkDupRS=null.next()){ segid=rs1.s_finger set finger_fla g='N' where finger_nameid='"+sCustKid+"' and finger_flag='Y' and finger_pertype= 'C' ").getBinaryStream(10). } if(!recFinger.'). stream_6 = fingerInsert.').isnull(finger_4. InputStream stream_9=null."+ " isnull(finger_6.').').s_finger where finger_nameid='"+sCustKid+"' and finger_flag='Y' and finger_pertype='C' ".'.isnull(fing er_2. ResultSet fingerInsert=db.'.'.equals("") && !habcode.

finger_pertype ) values (?.fing er_flag.finger_imageiso2.close().read(data2). stream_2.} PreparedStatement pstmt=null.?.setString(4. pstmt. byte []data1=new byte[stream_1.read(data3). stream_3.setString(4.setString(5.db_select(checkDup). stream_1. pstmt.next()){ rec=checkDupRS. int a=data1..s_finger (finger_nameid.length. pstmt.getString(1).prepareStatement( "insert into "+signDB+".1). pstmt.?. checkDupRS=db. pstmt.finger_imageiso2.executeUpdate().equals("0")){ pstmt = (db..setBytes(3.prepareStatement( "insert into "+signDB+".length.?.getConnectionDB()). pstmt.available()].read(data1). } if(rec. } if(rec. while(checkDupRS. pstmt. int c=data3.setBytes(3.equals("0")){ pstmt = (db."Y").?)"). String checkDup="select count(*) from "+signDB+".available()]..finger_id.next()){ rec=checkDupRS.sCustKid).?. } } byte []data3=new byte[stream_3.finger_id. while(checkDupRS. checkDupRS=db. pstmt.s_fing er" + " where finger_nameid='"+sCustKid+"' and finger_id='"+2+"' and finger_f lag='Y' ".fing er_flag.setLong(2.s_finger (finger_nameid.getString(1).s_fing er" + " where finger_nameid='"+sCustKid+"' and finger_id='"+1+"' and finger_fl ag='Y' ". pstmt...data1)."Y"). } } byte []data2=new byte[stream_2. pstmt. pstmt.available()].close(). pstmt."C").data2).?.s_fing .getConnectionDB()).?."C").setString(1. pstmt.sCustKid).setLong(2.length.?)"). if(b>10){ String rec="0". if(c>10){ String rec="0".setString(5.finger_pertype ) values (?. if(a>10){ String rec="0". pstmt. String checkDup="select count(*) from "+signDB+".db_select(checkDup).executeUpdate().2). String checkDup="select count(*) from "+signDB+". int b=data2.setString(1.

er" + " where finger_nameid='"+sCustKid+"' and finger_id='"+3+"' and finger_f lag='Y' ". pstmt.?)").sCustKid)..length.setString(5. pstmt. stream_4.getConnectionDB()).data4).getConnectionDB()).fing er_flag..read(data5). pstmt.3).finger_id. pstmt..?.setLong(2.executeUpdate()."Y").prepareStatement( "insert into "+signDB+".equals("0")){ pstmt = (db.setLong(2.s_finger (finger_nameid.?. } } byte []data4=new byte[stream_4. pstmt. pstmt.?.s_fing er" + " where finger_nameid='"+sCustKid+"' and finger_id='"+5+"' and finger_fl ag='Y' ".setString(1.setString(1.fing er_flag. pstmt. int e=data5.db_select(checkDup).getString(1). } if(rec.getString(1).length..equals("0")){ pstmt = (db.?.fing er_flag. } if(rec.finger_imageiso2.?)").finger_id.close()."C").finger_pertype ) values (?. } if(rec.?.db_select(checkDup).close()."C").finger_imageiso2. pstmt.available()].setString(4. pstmt..data3). String checkDup="select count(*) from "+signDB+". while(checkDupRS.s_fing er" + " where finger_nameid='"+sCustKid+"' and finger_id='"+4+"' and finger_fl ag='Y' ".available()].executeUpdate(). String checkDup="select count(*) from "+signDB+". stream_5.sCustKid). if(d>10){ String rec="0"."Y").next()){ rec=checkDupRS. while(checkDupRS.next()){ rec=checkDupRS.setString(4. if(e>10){ String rec="0".s_finger (finger_nameid.?)"). pstmt. while(checkDupRS. checkDupRS=db.finger_pertype ) values (?.?.read(data4).setBytes(3. pstmt. pstmt.db_select(checkDup).getConnectionDB()). checkDupRS=db. int d=data4.finger_id. checkDupRS=db.?. pstmt. pstmt.getString(1).?.setBytes(3.prepareStatement( "insert into "+signDB+". } } byte []data5=new byte[stream_5.s_finger (finger_nameid.finger_pertype ) values (?.setString(5.next()){ rec=checkDupRS. .?.prepareStatement( "insert into "+signDB+".finger_imageiso2.4).equals("0")){ pstmt = (db.

finger_pertype ) values (?. checkDupRS=db.s_finger (finger_nameid.setBytes(3. pstmt. pstmt.available()]."Y")."C").?.?)"). pstmt.setString(1.setString(1.setLong(2. checkDupRS=db.equals("0")){ pstmt = (db.?.sCustKid).setString(5.6).s_fing er" + " where finger_nameid='"+sCustKid+"' and finger_id='"+7+"' and finger_fl ag='Y' "."Y"). pstmt.setString(5.executeUpdate().data6).5).setString(4.setString(4.getConnectionDB()).executeUpdate().length.fing er_flag. } if(rec.length. stream_6.sCustKid). pstmt.prepareStatement( "insert into "+signDB+".db_select(checkDup). } if(rec.close().available()].prepareStatement( "insert into "+signDB+".available()].7).?)").equals("0")){ pstmt = (db.?.. pstmt. pstmt.next()){ rec=checkDupRS. .read(data7). } } byte []data7=new byte[stream_7.read(data6).db_select(checkDup). pstmt.getConnectionDB()). } } byte []data8=new byte[stream_8.setString(5.setString(1. int f=data6. pstmt.setBytes(3.pstmt. while(checkDupRS. stream_7. pstmt. if(g>10){ String rec="0"."Y"). pstmt."C").finger_pertype ) values (?..getString(1).setBytes(3. String checkDup="select count(*) from "+signDB+"..finger_imageiso2.fing er_flag.setString(4.?.getString(1)."C").finger_id.close().executeUpdate().data7).next()){ rec=checkDupRS.sCustKid).close().?. pstmt. pstmt. while(checkDupRS.setLong(2. int g=data7. pstmt..finger_imageiso2. pstmt. pstmt.finger_id.data5).setLong(2. pstmt. String checkDup="select count(*) from "+signDB+".s_finger (finger_nameid.s_fing er" + " where finger_nameid='"+sCustKid+"' and finger_id='"+6+"' and finger_fl ag='Y' ".?. pstmt. if(f>10){ String rec="0". pstmt. } } byte []data6=new byte[stream_6. pstmt.

"C"). pstmt. pstmt.?)").length.s_finger (finger_nameid.prepareStatement( "insert into "+signDB+".fing er_flag.next()){ rec=checkDupRS. int j=data10.setString(4. while(checkDupRS. pstmt. if(h>10){ String rec="0". pstmt. } if(rec."C").prepareStatement( "insert into "+signDB+". pstmt.length.8). stream_9.setLong(2.setString(5.. checkDupRS=db.setString(4. String checkDup="select count(*) from "+signDB+"."Y").?.9). } } byte []data9=new byte[stream_9.finger_pertype ) values (?. pstmt. pstmt.close().. checkDupRS=db. if(i>10){ String rec="0".data8).setLong(2. if(j>10){ String rec="0".sCustKid). pstmt.. pstmt.s_fing er" + " where finger_nameid='"+sCustKid+"' and finger_id='"+8+"' and finger_fl ag='Y' ".setString(5.setString(1.available()]..finger_pertype ) values (?. pstmt.s_fing er" + " where finger_nameid='"+sCustKid+"' and finger_id='"+9+"' and finger_fl ag='Y' ".stream_8.?. . pstmt.available()].?.data9).?)").finger_id.next()){ rec=checkDupRS.next()){ rec=checkDupRS.finger_imageiso2.?.s_fing er" + " where finger_nameid='"+sCustKid+"' and finger_id='"+10+"' and finger_f lag='Y' ". checkDupRS=db.db_select(checkDup).getString(1)."Y").fing er_flag. } } byte []data10=new byte[stream_10.?.getConnectionDB()).getString(1). while(checkDupRS. pstmt.getString(1).db_select(checkDup). String checkDup="select count(*) from "+signDB+".setBytes(3.executeUpdate(). String checkDup="select count(*) from "+signDB+".s_finger (finger_nameid.executeUpdate().read(data8). pstmt.?.read(data10). pstmt.getConnectionDB()). stream_10.finger_imageiso2. int i=data9. } if(rec.close().read(data9).finger_id.db_select(checkDup).setBytes(3. while(checkDupRS.equals("0")){ pstmt = (db. int h=data8.equals("0")){ pstmt = (db.setString(1.sCustKid)..length.

equals("") && !habcode. String recDoc="0". } public void insertDocPht(DataBaseClass db. while(rsDoc.?)").db_update("update "+signDB+". if(!pensionid. } String checkDupPht="select count(*) from "+signDB+". while(phtRs.. } else{ condition=" CustomerId='"+sCustKid+"'". } String phtinsert="insert into "+signDB+".next()){ recDoc=rsDoc. rsDoc=db.String pensionid .data10). ResultSet rsDoc=null. photo from s_HHTInsert where is_photo='Y' and "+condition+" " .fing er_flag.finger_imageiso2. .db_select(checkDupPht).setBytes(3.setString(1.getString(1).String custid.setString(4.?. } String checkDupPht="select count(*) from "+signDB+".} if(rec.s_docpht" + " where docpht_nameid='"+custid+"' and docpht_flag='Y' and docpht_pertype='C' ".?.equals("") ){ condition=" PENSIONID='"+pensionid+"' and HABCODE='"+hab code+"' ".db_Insert(phtinsert). } } } public void insertPhoto(DataBaseClass db. pstmt.finger_id.String habcode) throws Exception{ String recPht="0"."C").setLong(2.String sCustKid.s_pht set pht_flag='N' where pht_nameid='"+sCustKid+"' and pht_flag='Y' ").executeUpdate().?. String condition="". phtRs=db.s_finger (finger_nameid.pht_ pertype.close(). db.s_pht wher e pht_nameid='"+sCustKid+"' and pht_flag='Y' and pht_pertype='C' "..getConnectionDB()).getString(1).equals("") ){ condition=" PENSIONID='"+pensionid+"' and HABCODE='"+hab code+"' ". ResultSet phtRs=null.s_pht (pht_nameid.equals("0")){ db.'C'. } else{ condition=" CustomerId='"+custid+"'".prepareStatement( "insert into "+signDB+"..db_select(checkDupPht).setString(5.equals("0")){ pstmt = (db. String pension id.10). pstmt. } if(!recPht. pstmt. pstmt. pstmt. if(!pensionid.next()){ recPht=phtRs.finger_pertype ) values (?..equals("") && !habcode.sCustKid)..pht_flag. pstmt."Y").String habcode) throws Exception{ String condition="".'Y'. pstmt.pht_photo)select "+sCustKid+" .

'0. if( bankName.equals("0")){ db.acc_brancode.iac_natidno.'"+sACCOUNT_NUMBER+"'.s_docpht (docpht_nameid .acc_catbeh.'"+catID+"'.acc_ename.acc_cat.adr_ table . acn_custid. db.'G')"..adr_cityid.'"+sBr ancode+"'.'." + "'" +sMO_NAME+"'.'"+habCode+"')".db_Insert(sql1).'N'.db_Insert(insertIntoIac).'"+pensionId+"'.'"+classId+"'.'"+sADDRESS_1+"'.acc_catbeh) values " + "('"+sCustKid+"'.'"+Integer.'"+sPanchayatId+"'.'N'.'"+sFA_NAME+"'.acc_type.adr_cntid.'"+sDATE_OF_BIRTH+"' .'G'." + "'"+sVillageStateid+"'.cust_kid.iac_panno.acc_ename.'"+sCUSTOMER_SEX+"'. String bankCode) throws Exception{ String insertIntoIac="insert into s_iac (iac_custid.adr_Ehno.db_Insert(sql1).acc_mop.'"+sVi llageKid+"'.parseInt(c ityID)+"'.adr_flag.'"+sINTRODUCER_NAME+"'.db_Insert(docPhoto).acc_status .acn_status.iac_rlgnid.equalsIgnoreCase("State Bank of Hyderabad" )|| bank Code.'"+sINTRODUCER_TITLE+"' ) " . .'"+sPAN_NUMBER+"'.} if(!recDoc.iac_dob.iac_married.'"+sACCOUNT_NUMBER+"'.acc_hname.'"+cstKid+"'.' "+sVillage_Ename+"'. '"+rlgnKid+"'." + "iac_custgrp.'"+ocpID+"'.'"+sCustKid+"'." + "'"+sMARITAL_STATUS_CODE+"'.acc_status . acn_ettl.'2'.acc_type.'"+iac_minor+"'.docpht_photo.'"+sDD_CITY_TEXT+"'.acn_ename. } else{ sql1 =" insert into s_acc (acc_custid.acc_pensionid.iac_sex.'"+cntId+"'.acc_flag.'" +sLAST_UPDATED_DATE+"'.acc_ename.iac_eduqual.equals("004")){ sql1 =" insert into s_acc (acc_custid.ac c_opdate."+age+".'"+edukid+"'.acn_amount.acc_seqno.'L'. 'C' from s_HHTInsert where is_Docph oto='Y' and "+condition+" ".s_acc where acc_custid=cu st_kid and cust_kid='"+sCustKid+"' and acc_flag='T' and cust_status='Y')". String sql1="insert into s_adr (adr_fid.iac_horfettl . db.ac c_opdate.acc_flag.'"+Integer.'MR.'"+catID+"'.acc_no.'2'.'"+glKid+"'.'"+sCUSTOMER_NAME+"'. iac_emothernm.iac_grdyn.acc_no. cust_ettl .iac_intrtype) values ('"+sCustKid+"'.acc_cat.iac_cstid." + " doc_photo. String sqlAcn="insert into s_acn (acn_accid.acc_seqno.'"+iac_grdyn+"'.s_docpht set docpht_fla g='N' where docpht_nameid='"+custid+"' and docpht_flag='Y' "). iac _ocpid.acc_mop.'1'.'" +sLAST_UPDATED_DATE+"'.'"+sCUSTOMER_NAME+"'.iac_h orfename.String sCustKid.'CUST'.adr_eloc. St ring bankName.docpht_pertype) select "+custid+" .'"+sMop+"'.iac_nomyn.'"+glKid+"'.'"+ia c_nomyn+"'.'"+catID+"'.iac_conid.adr_pincode .adr_stateid.'"+sPINCODE+"'.acn_startdate.parseInt(custNature) +"'.ia c_intenarr..Acc_currency.adr_docno) values ('"+sCustKid+"'.iac_age.0000'.db_update("update "+signDB+".acn_dispid)" + " (select acc_kid. adr_distid.'"+sIDNUMBER+"')".'"+sVillageDistid+"'.'"+sCustKid+"'. } String docPhoto="insert into "+signDB+".docpht_flag. db.acc_habcode) values " + "('"+sCustKid+"'.cust_crdate.Acc_currency.acn_hname.acn_no.' T'.adr_ec ity. } public void insertDataIntoAllTables(DataBaseClass db. } db.'"+cntId+"'.' T'. iac_castid.'"+sMop+"'.iac_minor.adr_villege.acc_brancode.'Y'.'0' from s_cust.'Y'.'"+sBr ancode+"'.adr_panchayat.

adrcer_expirydt.adr_Ehno.adr_cityid.nom_dob.'"+a drDocNo+"'. db.'"+sCustKid+"'.next()){ acnKid=rs2.equals("NA")){ .nom_erel.other_issuedt.'. if(!sSPOUSE_NAME.adrcer_table)" + "(select adr_kid.adrcer_issuedt.spu_ocpid.adr_table .'"+sNOMINEE_DOB+"'.adr_docno) (select acn_kid.nom_table. db.'" +sBrancode+"'.adrcer _Hplace.spu_custid.db.'adrL' from s_adr where " + "adr_fid='"+sCustKid+"' and adr_table='CUST')".no m_date.adrcer_no. db. String acnKid="".'"+sIDNUMBER+"' from s_acn.parseInt(cityID)+"' .'"+sNET_INCOME+"')".getString(1). "+sNomAge+")".other_custid) values ('"+sIDTYPE_CODE+"'.adr_panchayat.a dr_ecity.'.'"+nomGender+"'.'"+addrExpDate+"'.db_Insert(sqlAdrcer).adr_eloc.adrcer_expirydt. adr_distid . } String sqlAcnAdr="insert into s_adr (adr_fid.'.adr _flag.'"+sIDTYPE_CODE+"'. ResultSet rs2=db.equals("NA")){ String sqlSpu="insert into s_spouse (spu_ename.adr_cntid.nom_usrid.adr_flag." + "adr_eloc.'.'.'adrL' from s_adr where adr_fid='"+acnKid+"' and adr_table= 'ACN')". adr_distid.spu_income) values ('"+sSPOUSE_NAME+"'.'Y'. db.s_adr.'.db_select("select acn_kid from s_acn.adrcer_eauthority. String sqlAdrcerAcn="insert into s_adrcer (adrcer_adrid. adrcer_docid.'"+adrDo cNo+"'. } if(!sGUARDIAN_NAME.adr_Ehno.db_Insert(sqlAcnAdr).adrcer_no.nom_age ) v alues ('"+acnKid+"'.'"+catID+"'.nom_flag.'ACN'.adr_villege.spu_cstid.adr_ecity.adrcer_table) " + "(select adr_kid.db_Insert(sqlAcn).'"+sIDTYPE_CODE+"'.db_Insert(sqlSpu).s_acc wher e acn_custid='"+sCustKid+"' and acc_brancode='"+sBrancode+"' and acn_custid=acc_ custid "). db.'.'"+addrDocIssuPlace+"'.db_Insert(sqlOth).'"+addrDocIssuAuth+"'.'"+sDD_RELCODE_TEXT+"'. if(!acnKid.'"+addrIssuDate+"'. other_docno.'"+adrDocNo+ "'.adr_stateid.db_Insert(sqlnom).nom_hname.adr_villege.'"+sLAST_UPDATED_DATE+"'.'"+addrIssuDate+"'. db.spu_hname .'"+cntId+"'.adr cer_issuedt.equals("")){ String sqlnom="insert into s_nom (nom_acnid.adr_pincode .'" +sNOMINEE_NAME+"'.adr_panchayat.nom_ename.'.adrcer_eplace.s_cust where adr_fid=cust_kid and adr_table='CUST' and " + " acn_custid=cust_kid and cust_kid='"+sCustKid+" ' and cust_status='Y' )" .'"+Integer.db_Insert(sqlAdrcerAcn).adrcer_Hplace." + "nom_brncode.'ACN'.'"+addrDocIssuAuth+"'.nom_sex.'"+sCustKid+"')".'"+addrDocIssuPlace+"'.adr_stateid. while(rs2.adrcer_eauthority.adrcer_doci d.'.adrcer_eplace.'.'. adrcer_hauthority.'"+ad drExpDate+"'. String sqlOth="insert into s_otherid (other_docid.'460'.adr_pincode . } String sqlAdrcer="insert into s_adrcer (adrcer_adrid. adrcer_hauthority.'"+addrIssuDate+ "'.'"+oc pID+"'.'.

" + iac_intenarr='"+sINTRODUCER_NAME+"'.grd_date." + iac_intrtype='"+sINTRODUCER_TITLE+"' wher iac_dob='"+sDATE_OF_BIRTH+"'. iac_horfettl='MR." + iac_emothernm='" +sMO_NAME+"'." + " cust_nicissdt='"+sUID_ISSUE_DATE+"' " + " where cust_kid ='"+cust_kid+"' "." + iac_nomyn='"+iac_nomyn+"'.'"+Int eger.parseInt(sGROSS_INCOME)+"'." + iac_married='"+sMARITAL_STATUS_CODE+"'.grd_erel) values ('"+sCustKid+"'. } String indsStr="insert into s_ocpDet (ocp_custId." + " cust_crdate='"+sLAST_UPDATED_DATE+"'.ocp_income1.db_update(sSqlInsert)." + " cust_nregajobcardno='"+naregaNumber+"'." + iac_natidno='"+cntId+"'.db_Insert(sqlinsert)." + iac_horfename='"+sFA_NAME+"'. String sSqlInsert=" update s_cust set" + " cust_oldkid='"+sCUSTOMER_ID+"' ." . String insertIntoIac=" " " " " " + " " " " " " " " " " " +"'.'"+Integer.ocp _netincome1) values ('"+sCustKid+"'." + " cust_nicno='"+sUID_NUMBER+"'." + " " " " " e iac_custid='"+cust_kid+"'" .db_Insert(indsStr).String sqlinsert="insert into s_grd (grd_custid." + iac_eduqual='"+edukid+"'.'"+sLA ST_UPDATED_DATE+"'.getC ommonParameter()." + " cust_segid='"+segid+"'." + iac_custgrp='"+catID+"'." + iac_panno='"+sPAN_NUMBER+"'.String cust_kid .'Y'.parseInt(custNature) update s_iac set" + iac_sex='"+sCUSTOMER_SEX+"'. db.'"+sDD_GUARDIAN_TEXT+"') "." + " cust_status='T'.grd_enam e.grd_flag.' .St ring bankCode." + " cust_branCode='"+sBrancode+"'. String bankName) throws Exception{ ResultSet rs=null." + " cust_ettl='"+sCUSTOMER_TITLE+"'." + " cust_cat='"+catID+"'. " + iac_rlgnid='"+rlgnKid+"'. " + iac_castid='"+cstKid+"'." + iac_age='"+age+"'." + iac_minor='"+iac_minor+"'. db. db.parseInt(sNET_INCOME)+"' )"." + iac_grdyn='"+iac_grdyn+"'." + " cust_type='M'.'"+sGUARDIAN_NAME+"'." + " cust_efname='"+sCUSTOMER_NAME+"'." + " cust_habit='"+habCode+"'. } public void updateDataIntoAllTables(DataBaseClass db." + iac_cstid='"+classId+"'." + iac_conid='"+Integer. CommonParameter commonParameter = new GiveCommonParameter()." + " cust_ename='"+sCUSTOMER_NAME+"'." + iac_ocpid='"+ocpID+"'." + " cust_pensionumber='"+pensionId+"'.

" + " acc_status='N'.db_update(insertIntoIac)." + " acc_pensionid='"+pensionId+"'. in SBH " acc_catbeh='G'." + " adr_docno='"+sIDNUMBER+"' where adr_fid=' "+cust_kid+ "' and adr_table='CUST' "." + adr_panchayat='"+sPanchayatId+"'." + " acc_catbeh='G' " + " WHERE acc_custid='"+cust_kid+"' ".db." + " acc_habcode='"+habCode+"' WHERE acc_ custid='"+cust_kid+"' "." + " adr_cntid='"+cntId+"'." + " acc_flag='T'." + adr_cityid='"+Integer.geti BankCurrency()+"'. db.geti BankCurrency()+"'." + " acc_currency='"+commonParameter." + adr_ecity='"+sDD_CITY_TEXT+"'." + " acc_currency='"+commonParameter." + " acc_brancode='"+sBrancode+"'." + adr_villege='"+sVillageKid+"'." + adr_eloc='"+sVillage_Ename+"'." + " acc_mop='"+sMop+"'." + " acc_brancode='"+sBrancode+"'.db_update(sql1)." + " acc_seqno='"+cust_kid+"'." + adr_distid='"+sVillageDistid+"'. if( bankName." + " acc_type='"+glKid+"'." + adr_flag='L'." + adr_table='CUST' ." + //" acc_seqno='"+cust_kid+"'." + " acc_type='"+glKid+"'." + " acc_opdate='" +sLAST_UPDATED_DATE+"' .parseInt(cityID)+"' ." + adr_stateid='"+sVillageStateid+"'.equals("004")){ sql1 =" update s_acc set " + // " acc_no='"+sACCOUNT_NUMBER+"' ." + " acc_cat='"+catID+"'." + adr_pincode='"+sPINCODE+"' . String sql1=" update " " " " " " " " " " " .equalsIgnoreCase("State Bank of Hyderabad" ) || ban kCode. } s_adr set " + adr_Ehno='"+sADDRESS_1+"'." + " acc_cat='"+catID+"'." + " acc_ename='"+sCUSTOMER_NAME+"'." + // co mment because this is not req." + " acc_opdate='" +sLAST_UPDATED_DATE+"' . } else{ sql1 =" update s_acc set " + " acc_no='"+sACCOUNT_NUMBER+"' ." + " acc_mop='"+sMop+"'." + " acc_ename='"+sCUSTOMER_NAME+"'." + " acc_status='N'." + " acc_flag='T'.

while(rs." + " acn_startdate='"+accStartDate+"'." + " acn_dispid='0' " + " where acn_accid='"+accKid+"' and acn_custid=' "+accCustId+"' ". accHname=rs. String nom_minor=""." + " adr_docno='"+sIDNUMBER+"' where adr_fid='"+ac nKid+ "' and adr_table='ACN' ".0000'.getString(5). String accStartDate="". String accDataSelForAcn=" select acc_kid." + " acn_amount='0. } sql1=" update s_acn set " + " acn_ename='"+accEname+"'.getString(3). db.db_update(sql1)." + " acn_status='Y'.db_select(accDataSelForAcn). String accCustId="".getString(1). String accHname="". accEname=rs. String nominee_kid="0"." + " adr_cntid='"+cntId+"'. rs=db. rs=db.acc_hname.db_update(sql1)." + " adr_pincode='"+sPINCODE+"' . db. .next()){ accKid=rs. cu st_ettl." + " adr_cityid='"+Integer. String accEttl="". accEttl=rs." + " adr_flag='L'." + " adr_eloc='"+sVillage_Ename+"'. while(rs.getString(1).acc_ename.getString(2).cust_kid. String acnKid="". String accEname=""." + " adr_stateid='"+sVillageStateid+"'.cust_crdate from s_cust." + " acn_no='1'." + " acn_hname='"+accHname+"'.db.next()){ acnKid=rs." + " acn_ettl='"+accEttl+"'.s_acc where acn_cust id='"+cust_kid+"' and acc_brancode='"+sBrancode+"' and acn_custid=acc_custid an d acc_kid=acn_accid "). accCustId=rs. } sql1=" update s_adr set " + " adr_Ehno='"+sADDRESS_1+"'.parseInt(cityID)+"'.s_acc where acc_custid=cust_kid and cus t_kid='"+cust_kid+"' and acc_flag='T' and cust_status='T'"." + " adr_table='ACN' . String accKid=""." + " adr_distid='"+sVillageDistid+"'.getString(4)." + " adr_villege='"+sVillageKid+"'." + " adr_panchayat='"+sPanchayatId+"'." + " acn_custid='"+accCustId+"'.db_select(" select acn_kid from s_acn. accStartDate=rs." + " adr_ecity='"+sDD_CITY_TEXT+"'.getString(6).db_update(sql1).

equals("")){ String sSql4="select nom_kid from s_nom where no m_acnid='"+acnKid+"' and nom_table='ACN'".'"+nom_minor+"'.println(sql1). db. while (rs4. " + "nom_usrid.out.next()){ nominee_kid=rs4. ResultSet rs4=db." + " nom_flag='Y'." + "nom_erel. db." + " nom_hname='. ResultSet rs4=db." + " nom_ename='"+sNOMINEE_NAME+"' . " + " nom_dob='"+sNOMINEE_DOB+"'.next()){ nominee_kid=rs4." + " nom_erel='"+sDD_RELCODE_TEXT+ "'." + "nom_ename. .equals("004")){ String sSql4="select nom_kid from s_nom where nom_acnid= '"+cust_kid+"' and nom_table='CUST'". }else{ nom_minor="N".if( bankName. } if(nominee_kid.getString(1)." + " nom_sex='"+nomGender+"'." + " nom_table='CUST'.db_select(sSql4)." + "nom_table) " + "values ('"+cust_kid+"'. }else{ sql1=" update s_nom set " + " nom_usrid='"+userid+"'.'"+userid+"'.'Y'." + "'"+sLAST_UPDATED_DATE+"'.'"+sDD_RELCODE_TEXT+"'." + "nom_age." + " nom_brncode='" +sBrancode+"'.'"+sNomAge+"'.'. System.'CUST')". while (rs4." + "nom_date." + " nom_date='"+sLAST_UPDATED_DAT E+"'." + "nom_minor.getString(1).db_update(sql1).db_select(sSql4)." + "nom_sex." + "nom_flag. } } else{ if(!acnKid.equalsIgnoreCase("State Bank of Hyderabad" ) || ban kCode.equals("0")){ String sql1Insert="insert into s_nom (nom_acnid. } if(sNomAge>18){ nom_minor="Y".'"+sNOM INEE_NAME+"'." + "'"+nomGender+"'.db_Insert(sql1Insert)." + " nom_age='"+sNomAge+"' WHERE n om_acnid='"+cust_kid+"' ".

" + " nom_hname='.getString(1)." + " nom_sex='"+nomGender+"'." + " adrcer_no='"+adrDocNo+"'." + " nom_age='"+sNomAge+"' WHERE n om_acnid='"+acnKid+"' ".'"+sNomAge+ "'.'CUST')"." + "nom_date." + " nom_flag='Y'.equals("")){ rs=db." + " nom_table='ACN'.'"+nom_minor+"'." + "nom_usrid.db_Insert(sql1Insert).'"+sNOMINEE_NAME+"'.'." + "nom_minor.next()){ adrKidOfACN=rs." + "'"+nomG ender+"'." + "nom_ename. } } } if(!acnKid." + "nom_erel." + " nom_date='"+sLAST_UPDATED_DAT E+"'." + "nom_sex. db." + "nom_flag.db_update(sql1).'Y'." + "nom_age.} if(sNomAge>18){ nom_minor="Y"." + " nom_brncode='" +sBrancode+"'. String adrKidOfACN="".'"+sDD_RELCODE_TEXT+"'." + .equals("0")){ String sql1Insert="insert into s_nom (no m_acnid. } else{ sql1=" update s_nom set " + " nom_usrid='"+userid+"'.db_select("Select adr_kid from s_adr where adr_fid ='"+acnKid+"' and adr_table='ACN' ")." + " nom_erel='"+sDD_RELCODE_TEXT+ "'." + "nom_table) " + "values ('"+cust_kid+"'. }else{ nom_minor="N". " + " nom_dob='"+sNOMINEE_DOB+"'." +"'"+sLAST_UPDATED_DATE+"'. while(rs." + " nom_ename='"+sNOMINEE_NAME+"' . '"+userid+"'. db. } sql1=" update s_adrcer set " + " adrcer_docid='"+sIDTYPE_CODE+"'. } if(nominee_kid.

db_update(sql1)." + " adrcer_expirydt='"+addrExpDate+"'. db. while(rs3." adrcer_eauthority='"+addrDocIssuAuth+ "'." + " adrcer_eauthority='"+addrDocIssuAuth+ "'." + " adrcer_hauthority='. } sql1=" update s_adrcer set " + " adrcer_docid='"+sIDTYPE_CODE+"'." + adrcer_expirydt='"+addrExpDate+"'. } else{ String sql4="insert into s_otherid (other_docid." + " adrcer_table='adrl' " + " where adrcer_adrid='"+adrKidOfCust+"' ".equals("")){ sql1=" update s_otherid " + " set other_docid='"+sIDTYPE_CODE+"'.next()){ othrid=rs3. String othrid="". " + " " " " " ".other_is suedt." + "'"+addrIssuDate+"'.db_select(sql3)." + " adrcer_eplace='"+addrDocIssuPlace+"'." + " other_issuedt='"+addrIssuDate+"'. adrcer_Hplace='." + adrcer_issuedt='"+addrIssuDate+"'." + "'"+cust_kid+"')". db. rs=db. } if(!othrid. ResultSet rs3=db.'.getString(1)." + " adrcer_issuedt='"+addrIssuDate+"'.other_custid)" + " values " + "('"+sIDTYPE_CODE+"'.'.next()){ adrKidOfCust=rs." + " adrcer_hauthority='.db_update(sql1).db_update(sql1). while(rs." + adrcer_table='adrl' " + where adrcer_adrid='"+adrKidOfACN+"' .db_select("Select adr_kid from s_adr where adr_fid ='"+cust_kid+"' and adr_table='CUST' ")." + "'"+adrDocNo+"'.getString(1). db.'. " + " adrcer_Hplace='. String adrKidOfCust=""." + " adrcer_no='"+adrDocNo+"'." + " adrcer_eplace='"+addrDocIssuPlace+"'. } String sql3="select other_kid from s_otherid where other_custid= '"+cust_kid+"'".other_docno.'." + " other_docno='"+adrDocNo+"' " + " where other_custid='"+cust_kid+"' ".

db. db." + " grd_erel='"+sDD_GUARDIAN_TEXT+"' where grd_custid='"+cust_kid+"' ". } } if(!sGUARDIAN_NAME.db_Insert(sql4).'.db_update(sql1).db..s_pht where ph t_nameid='"+cust_kid+"' and pht_flag='Y' ").spu_ocpid.db_update(sql1).getString(1)." + " grd_flag='Y'. } else { String sql4="insert into s_spouse (spu_ename." + "'"+catID+"'." + " spu_income='"+sNET_INCOME+"' w here spu_custid='"+cust_kid+"' ". if(!sSPOUSE_NAME." + " spu_cstid='"+catID+"'." + "'"+ocpID+"'.spu_cstid.db_Insert(sql4). } sql1=" update s_ocpDet set " + " ocp_income1='"+Integer.equals("NA")){ sql1=" update s_grd set " + " grd_ename='"+sGUARDIAN_NAME+"'.spu _hname. ResultSet rs13=db.next()){ spukid=rs13." + " spu_hname='." + " ocp_netincome1 ='"+Integer." + "'. } if(!spukid. rs=db.parseInt(sGROSS_INCOME) +"' .db_update(sql1).parseInt(sNET_INCOM E)+"' where ocp_custId='"+cust_kid+"'". db." + " grd_date='"+sLAST_UPDATED_DATE+"'. db." + "'"+cust_kid+"')". db. . String spukid="".spu_custid)" + " values " + "('"+sSPOUSE_NAME+"'.db_select(" select pht_kid from "+signDB+".spu_income.equals("")){ sql1=" update s_spouse set " + " spu_ename='"+sSPOUSE_NAME+"'.db_select(sql31).db_update(sql1)." + " spu_ocpid='"+ocpID+"'.equals("NA")){ String sql31="select spu_kid from s_spouse where spu_cus tid='"+cust_kid+"'"." + "'"+sNET_INCOME+"'.'. } sql1=" update s_fiaofdtl set " + " ficust_rationcard='"+adrDocNo+"' where ficust_ custid='"+cust_kid+"' ". while(rs13.

getString(1). } rs=db.. String fingerAlReadyExist="". String keys = "".db_update(sql1). Object> updateH) t hrows Throwable { try { String sQuery = "UPDATE " + table + " SET ". } catch (Throwable ex) { throw ex. .equals("")){ sql1="Update "+signDB+". } System. while(rs.. keys = keys + ". } } public void main(DataBaseClass db){ HashMap<String. } rs=db. db. } if(!fingerAlReadyExist. String docphtAlReadyExist="".i++){ mapValues=new HashMap<String.s_pht set pht_flag='N' where ph t_nameid='"+cust_kid+"' and pht_flag='Y' ".next()){ phtAlReadyExist=rs.. db.s_docpht set docpht_flag='N' wh ere docpht_nameid='"+cust_kid+"' and docpht_flag='Y' "."s_acc". HashMap<String.db_select(" select docpht_kid from "+signDB+".String phtAlReadyExist="".next(). } } public void updateQuery(String table.db_select(" select finger_kid from "+signDB+". for(int i=0. Object>(). key=(String) iterator."s_acn". while (iterator.equals("")){ sql1="Update "+signDB+".equals("")){ sql1="Update "+signDB+".out.Object> mapValues=null. while(rs.println(sQuery+ keys. while(rs..next()){ fingerAlReadyExist=rs.i<tableName.s_finger wh ere finger_nameid='"+cust_kid+"' and finger_flag='Y' "). db." +key + "= "+updateH.getString(1)."s_nom"}.db_update(sql1)..s_finger set finger_flag='N' wh ere finger_nameid='"+cust_kid+"' and finger_flag='Y' ".hasNext()){ String key="".s_docpht wh ere docpht_nameid='"+cust_kid+"' and docpht_flag='Y' ").getString(1).db_update(sql1).keySet().iterator(). } if(!phtAlReadyExist.length. Iterator iterator = updateH.substring(1)). } if(!docphtAlReadyExist."s_iac".next()){ docphtAlReadyExist=rs.get(key)+" ". String[] tableName={"s_cust".

i < mapValuesArrayList. HHTDataField_Ename " + " from taMap.getStr ing(2)).db_select(" select hhtdatamap_tableColumn. } catch (Throwable t) { t. i++) { try { updateQuery(tableName[i]. } } catch(Exception e){ e. rs=db.size(). rs.get(i)). } } } } s_hhtDa .s_hhtdatafield " + " where hhtdatafield_ki d=hhtdatamap_hhtdataFieldid" + " and hhtdatafield_IsEdi table='Y'" + " and hhtdatamap _tablename='"+tableName[i]+"'").next()){ mapValues.printStackTrace().try{ ResultSet rs=null. Object >) mapValuesArrayList.add(mapValues). while(rs.getString(1). } mapValuesArrayList.put(rs.printStackTrace(). } for (int i = 0.(HashMap<String.