Hello, JSF h has used: Data Table - JSF DataAbple is empty, my SP return value is returned , But only the headers are seen in the browser, table values do not appear in the browser.
My JSP My Bean Public Class DataTableBean { } Faces-Config.xml Just run a debugger or said that this expensive DB job should not really be done in getter . During the request, it can be said many times that you can make your DB unnecessary hit / stress Do not want to enter. Take DB job in the manufacturer of bean Also, you are not explicitly shutting down the DB resources to
Private list & lt; BillTransPay & gt; List; Public listing & lt; Biltranspeck & gt; GetList () {String SP_BILLPAY = "{call sp_aw_Bill trance pay (?,?,?,?,?,?,?)}" Connection con = null; Results set rs = null; Try {class.forName ("com.microsoft.sqlserver.jdbc.SQLServerDriver"); Con = java.sql.DriverManager .getConnection (conString); Callable Stattement cbls = con .prepareCall ("{call sp_aw_Bill trance pay (?,?,?,?,?,?,?)}"); Cbls.setString (1, "CSF"); Cbls.setString (2, "20100101"); Cbls.setString (3, "20100301"); Cbls.setString (4, "B"); Cbls.setString (5, "01CS"); Cbls.setString (6, "ALL"); Cbls.setInt (7, 14000); Rs = cbls.executeQuery (); List = New Arrestist & lt; BillTransPay & gt; (); While (rsnext ()) {BillTranspace BTP = New BillTranspace (); Btp.setSponsorID (rs.getString ("SponsorCode")); Btp.setSponsorName (rs.getString ("SponsorName")); Btp.setDistributorID (rs.getString ("DistID")); Btp.setDistributorName (rs.getString ("DistName")); List.add (BTP); }} Hold (Exception pre) {ex.printStackTrace (); } Return list; } Public Zero set list (list & gt; BillTransPay & gt; list) {this.list = list; }
** & lt; Managed-Bean & gt; & Lt; Managed-name names & gt; DataTableBean & lt; / Managed-name names & gt; & Lt; Successful bean category & gt; Com.SQLProcess.dto.DataTableBean & lt; / Managed-van-class & gt; & Lt; Realm of managed-beams & gt; Request & lt; / Managed-beans scope & gt; & Lt; / Managed-Bean & gt; **
System.out.println (list ); correct
back to the list; to see that method is called and the list contains items in actually .
Connection ,
Description and
ResultSet . In the form of the
end same
try you need to close them where you have received them.
Comments
Post a Comment