void notrans(){ // this is my function : try{ String sql="select right(No_Trans,2) as no_akhir from jual"; Statement stat=conn.createStatement(); ResultSet res=stat.executeQuery(sql); if(res.first()==false){ txttrans.setText("TRX0001"); }else{ res.last(); int no=res.getInt(1)+1; String cno=String.valueOf(no); int pjg_cno=cno.length(); for(int i=0;i<2-pjg_cno;i++){ cno="00"+cno; } txttrans.setText("TRX00"+cno); } }catch(Exception e ){ } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)