I created a GUI for user to sign up and I want to make it clear that user havent signed up before.I save all info in a Exel folder that I created with apache poi.It was working good until I add this Property.It doesnt write info to folder whether User signed up before or not.
and It doesn't throw Exception It works like nothing wrong
public void kullaniciGuncelle(String tc, String ad, String soyad, String musteri_no, String telefon, String hesap_turu)throws Exception{
while (ayniVeriKontrol(tc,musteri_no)){
fileInputStream = new FileInputStream("Test.xls");
isimsiz_banka_verileri = new HSSFWorkbook(fileInputStream);
musteri =isimsiz_banka_verileri.getSheetAt(0);
sayac = 1 + musteri.getLastRowNum();
row2 = musteri.createRow(sayac);
celli = row2.createCell(0);
celli.setCellValue(tc);
celli = row2.createCell(1);
celli.setCellValue(ad);
celli = row2.createCell(2);
celli.setCellValue(soyad);
celli = row2.createCell(3);
celli.setCellValue(musteri_no);
celli = row2.createCell(4);
celli.setCellValue(telefon);
celli = row2.createCell(5);
celli.setCellValue(hesap_turu);
fileInputStream.close();
fileOutputStream = new FileOutputStream("Test.xls");
isimsiz_banka_verileri.write(fileOutputStream);
isimsiz_banka_verileri.close();
fileOutputStream.close();
}
}
public boolean ayniVeriKontrol(String tc, String musteri_no) throws Exception{
boolean kontrol = false;
String geciciTc ,geciciNo;
fileInputStream = new FileInputStream("Test.xls");
isimsiz_banka_verileri = new HSSFWorkbook(fileInputStream);
musteri = isimsiz_banka_verileri.getSheetAt(0);
sayac = 1 + musteri.getLastRowNum();
for (int i = 1; i < sayac; i++) {
row2 = musteri.getRow(i);
celli = row2.getCell(0);
geciciTc = celli.getStringCellValue();
celli = row2.getCell(3);
geciciNo = celli.getStringCellValue();
if (geciciTc == tc) {
System.out.println("Ayılar");
kontrol = true;
}
}
fileInputStream.close();
return kontrol;
}