Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
How to solve this problem(Urgent)

How to solve this problem(Urgent)

2005-06-30       - By Andy Susanto

 Back
Reply:     1     2     3  

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 = 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 =
Con.prepareStatement(sbSQLStatement.toString());

   ResultSet rsTransLocker = pstmtTransLocker.executeQuery();

   while (rsTransLocker.next()){
           String BillingIDData =
rsTransLocker.getString("A.TransLockerID");
           LastBillingID = Integer.parseInt(BillingIDData);
           String FacilityPrice =
rsTransLocker.getString("A.FacilityPrice");
           String BillingNo = rsTransLocker.getString("A.TransLockerNo");
           String LockerNo = rsTransLocker.getString("B.LockerNo");
           String LoginName = rsTransLocker.getString("C.LoginName");
           String Date = rsTransLocker.getString("DateOut");
           String Time = rsTransLocker.getString("A.TimeOut");
           String MemberNo = rsTransLocker.getString("A.MemberNo");
           double Discount = 0;
           if (0 == rsTransLocker.getDouble("A.DiscountFasilitasMember")){
                   Discount =
rsTransLocker.getDouble("A.DiscountFasilitasUmum");
           }
           if (0 == rsTransLocker.getDouble("A.DiscountFasilitasUmum")){
                   Discount =
rsTransLocker.getDouble("A.DiscountFasilitasMember");
           }
           double DiscountFBMember =
rsTransLocker.getDouble("A.DiscountFBMember");
           double DiscountFBUmum =
rsTransLocker.getDouble("A.DiscountFBPublic");
           double DiscountMassageMember =
rsTransLocker.getDouble("A.DiscountMassageMember");
           double DiscountMassageUmum =
rsTransLocker.getDouble("A.DiscountMassagePublic");
           String VoucherNo = rsTransLocker.getString("A.VoucherNo");
           double VoucherPrice = rsTransLocker.getDouble("A.VoucherPrice");
           String FreepassNo = rsTransLocker.getString("A.FreepassNo");
           double FreepassPrice =
rsTransLocker.getDouble("A.FreepassPrice");
           String PembayaranDengan = rsTransLocker.getString("A.PaidWith");
           String KetPembayaran = rsTransLocker.getString("A.KetPaidWith");
           double Bayar = rsTransLocker.getDouble("A.Payment");


           StringBuffer sbHasil= new StringBuffer("<TR><TD>");
           sbHasil.append("<INPUT TYPE='CHECKBOX'
NAME='chkcetakbill").append(counterobj).append("'
VALUE=1>").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='TEXT'
NAME='cetakbill").append(counterobj).append("'
VALUE='").append(counterobj).append("'></TD>"); //BillingIDData
           sbHasil.append("</TR>").append(NewLine.CodeBreak());

           puDisplayPage.DisplayPage(sbHasil.toString(),out);
           counterobj++;
           sbHasil = new StringBuffer(counterobj);
           puDisplayPage.DisplayPage(sbHasil.toString(),out);
   }
}

TIA,

Andy Susanto

__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __
To unsubscribe, send email to listserv@(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

©2008 junlu.com - Jax Systems, LLC, U.S.A.