Re: [Help] How to solve this problem(Urgent)
Duc Vo <[email protected]> Fri, 1 Jul 2005 13:43:27 +1000
| Newsgroups | gmane.comp.java.sun.servlet |
|---|---|
| Message-ID | <[email protected]> |
Do you homework on local variable pal ...=20 -----Original Message----- From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[email protected]] On Behalf Of Andy Susanto Sent: Friday, 1 July 2005 1:22 PM To: [email protected] Subject: [Help] How to solve this problem(Urgent) Importance: High Hai, i have a problem like this. In my result the data not display perfect. in my suspicion 1. i have a problem in ResultSet 2. i have problem in StringBuffer so i test my suspicion in point 1, i remark inside while loop and i place breakpoint after function "Proses_Menampilkan_Data". And i get a Result but when i test my suspicion in point 2, and i get a data, but not a perfect. Because Char "A" never been exist in the output, after that when i "view Source" from an IE or Mozilla this Word "A</BODY></HTML>" not exist to how can i solve the problem i need your help guys. This is my partial Code : String Buffer sbHasil =3D new StringBuffer("<HTML><BODY>").append(NewLine.CodeBreak()); Proses_Menampilkan_Data(puDisplayPage,out,Con); sbHasil.append("A</BODY></HTML>"); puDisplayPage.DisplayPage(sbHasil.toString(),out); private void Proses_Menampilkan_Data(PermanentUse puDisplayPage, ServletOutputStream out, Connection Con) throws SQLException,IOException{ PreparedStatement pstmtTransLocker =3D Con.prepareStatement(sbSQLStatement.toString()); ResultSet rsTransLocker =3D pstmtTransLocker.executeQuery(); while (rsTransLocker.next()){ String BillingIDData =3D rsTransLocker.getString("A.TransLockerID"); LastBillingID =3D Integer.parseInt(BillingIDData); String FacilityPrice =3D rsTransLocker.getString("A.FacilityPrice"); String BillingNo =3D rsTransLocker.getString("A.TransLockerNo"); String LockerNo =3D rsTransLocker.getString("B.LockerNo"); String LoginName =3D rsTransLocker.getString("C.LoginName"); String Date =3D rsTransLocker.getString("DateOut"); String Time =3D rsTransLocker.getString("A.TimeOut"); String MemberNo =3D rsTransLocker.getString("A.MemberNo"); double Discount =3D 0; if (0 =3D=3D rsTransLocker.getDouble("A.DiscountFasilitasMember")){ Discount =3D rsTransLocker.getDouble("A.DiscountFasilitasUmum"); } if (0 =3D=3D rsTransLocker.getDouble("A.DiscountFasilitasUmum")){ Discount =3D rsTransLocker.getDouble("A.DiscountFasilitasMember"); } double DiscountFBMember =3D rsTransLocker.getDouble("A.DiscountFBMember"); double DiscountFBUmum =3D rsTransLocker.getDouble("A.DiscountFBPublic"); double DiscountMassageMember =3D rsTransLocker.getDouble("A.DiscountMassageMember"); double DiscountMassageUmum =3D rsTransLocker.getDouble("A.DiscountMassagePublic"); String VoucherNo =3D rsTransLocker.getString("A.VoucherNo"); double VoucherPrice =3D rsTransLocker.getDouble("A.VoucherPrice"); String FreepassNo =3D = rsTransLocker.getString("A.FreepassNo"); double FreepassPrice =3D rsTransLocker.getDouble("A.FreepassPrice"); String PembayaranDengan =3D rsTransLocker.getString("A.PaidWith"); String KetPembayaran =3D rsTransLocker.getString("A.KetPaidWith"); double Bayar =3D rsTransLocker.getDouble("A.Payment"); StringBuffer sbHasil=3D new StringBuffer("<TR><TD>"); sbHasil.append("<INPUT TYPE=3D'CHECKBOX' NAME=3D'chkcetakbill").append(counterobj).append("' VALUE=3D1>").append("</TD><TD NOWRAP>"); sbHasil.append(Date).append("</TD><TD>"); sbHasil.append(BillingNo).append("</TD>"); GetTransaksiMassage(BillingIDData,Con,out); GetTransaksiRestoran(BillingIDData,Con,out); GetTransaksiBar(BillingIDData,Con,out); GetTransaksiSalon(BillingIDData,Con,out); sbHasil.append(SubTotal()); sbHasil.append("<TD><INPUT TYPE=3D'TEXT' NAME=3D'cetakbill").append(counterobj).append("' VALUE=3D'").append(counterobj).append("'></TD>"); //BillingIDData sbHasil.append("</TR>").append(NewLine.CodeBreak()); puDisplayPage.DisplayPage(sbHasil.toString(),out); counterobj++; sbHasil =3D new StringBuffer(counterobj); puDisplayPage.DisplayPage(sbHasil.toString(),out); } } TIA, Andy Susanto ________________________________________________________________________ ___ To unsubscribe, send email to [email protected] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [email protected] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html