tag:blogger.com,1999:blog-8088462582218171132023-07-17T21:55:37.176-07:00ZATTYJava people looking for help ....ZATTYhttp://www.blogger.com/profile/03201161793771123940noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-808846258221817113.post-85345051701407294732012-05-11T22:19:00.001-07:002012-05-11T22:19:07.555-07:00XML rule engine<div dir="ltr" style="text-align: left;" trbidi="on">
XML rule engine</div>ZATTYhttp://www.blogger.com/profile/03201161793771123940noreply@blogger.com0tag:blogger.com,1999:blog-808846258221817113.post-29617874095046227512011-12-27T05:14:00.000-08:002011-12-27T05:19:14.030-08:00XML parsing in javaThere are various ways to parse a xml file . The most basic approach is dom parsin.<br />Apart from that we can use other parsers like <br />1. Sax parser<br />2. Stax parser<br />3. VTD xml parser.<br /><br />Apart from that we can also user xpath to navigate to different xml nodes.<br /><br /><span style="font-weight:bold;">DOM parsing:</span>ZATTYhttp://www.blogger.com/profile/03201161793771123940noreply@blogger.com0tag:blogger.com,1999:blog-808846258221817113.post-38194332720345666122009-10-06T06:59:00.000-07:002009-10-06T07:20:30.764-07:00Jasper RepportWith <strong>Jasper Report </strong>it has been found that reporting is become easy to desing and integrate with Java application . So far there are many other way to represent a group of data in a organised manner using <strong>Jfree chart </strong>or iReport or some time may be usiong <strong>Open Lazlo</strong>. Similarly Jasper Report.... But obviously each has it's own essence and how to make that beat use in any application always comes with profound understanding with technical part .....<br /><br /> Step 1. Get a database connection and Retrive the result for the specific query .<br />*************************************************************************************<br /><br />public static ResultSet establishConnection(){<br /> Connection con = null;<br /> Statement stmt = null;<br /> ResultSet rs = null ;<br /><br /> try {<br /> Class.forName("***********").newInstance();<br /> con = DriverManager.getConnection("**********","username", "password");<br /> <br /> stmt= con.createStatement();<br /> rs = stmt.executeQuery("SELECT * FROM test.countrylist order by countryName") ;<br /> <br /> <br /> } catch (Exception e) {<br /> e.printStackTrace();<br /> }<br /><br /> return rs;<br /> <br /> }<br /><br />*************************************************************************************<br /><br /><br /><br /> Step 2.Generate the JRXML file.<br /><br /><br /> step 3.Pass the above with a HashMap in JasperFillManager.fillReport and then generate report.<br /><br />*************************************************************************************<br /><br />public static void generateReport(){<br /><br /> int i ;<br /> <br /> try {<br /> Date d;<br /> JasperReport jasperReport; <br /> JasperPrint jasperPrint;<br /> ResultSet rs = establishConnection(); <br /> HashMap jasperParameter = new HashMap(); <br /> JRResultSetDataSource jasperReports = new JRResultSetDataSource(rs); <br /><br /> InputStream input = new FileInputStream(new File("F:/jaspertest.jrxml"));<br /> JasperDesign design = JRXmlLoader.load(input);<br /><br /> <br /> jasperReport = JasperCompileManager.compileReport(design); <br /> jasperPrint = JasperFillManager.fillReport(jasperReport,jasperParameter, jasperReports);<br /> <br /> <br /> JasperExportManager.exportReportToPdfFile(jasperPrint, "F:/sample_report.pdf"); <br /> JasperExportManager.exportReportToHtmlFile(jasperPrint, "F:/sample_report.html" ); <br /> <br /> <br /> }<br /> catch (JRException e)<br /> {<br /> e.printStackTrace();<br /> }<br /> catch (Exception e)<br /> {<br /> e.printStackTrace();<br /> }<br /> <br />}<br /><br />*************************************************************************************ZATTYhttp://www.blogger.com/profile/03201161793771123940noreply@blogger.com0tag:blogger.com,1999:blog-808846258221817113.post-36943583857691256362009-06-09T08:37:00.001-07:002009-06-09T22:29:03.689-07:00Struts conceptual questions.....Some more questions from <strong><em>conceptual</em></strong> part of struts ....<br /><strong>And</strong> above all always go through a good tutorial before starting with these things as there is no <strong>intelligence</strong> to findout and <strong>rember the answers</strong> without understanding the logic behind that.....<br /> <br /><br />1. How many minimum number of JAR file specific to Struts I need to start with a struts application ?<br /><br />2. Which class basically populates the values coming from JSP pages to actionform ?<br /><br />3. "<em>Ideal struts architecture says we should not keep our business logic related thing inside a action form class </em>"...(although it is absolutely possible) ....why?<br /><br />4.Where or in which scope actually struts keeps instancees of it's action form ---a)request b)session ,c)application <br /><br />5. What is the significance of load-on-startup with a positive , negative or zero? Now if the value is 10 in that case when the instance of that action class will be created ?<br />6. What are the parameter of a action forward class accepts ?<br /><br />7. What is the name of controller in struts framework ?<br /><br />8. How to setup a validator framework in struts ?<br /><br />9. What are the different kind of actionform classes ?<br /><br />10. Which class creates the instance of action class and what is the difference between a execute and perform ?<br /><br />11. Discuss among various action classes and which one is most efficient in which business situation ?<br /><br />12. What is the difference between struts 1.1 and struts 1.2 ?<br /><br />13. How I can create a dropdown using struts tags and which will read value from session ?<br /><br />14. How could I enable client side validation ?<br /><br /><strong>Regards <br /><br />Zatty</strong>ZATTYhttp://www.blogger.com/profile/03201161793771123940noreply@blogger.com0tag:blogger.com,1999:blog-808846258221817113.post-1587730692677942522009-06-07T13:24:00.001-07:002009-06-08T09:21:32.854-07:00J2EE Interview Questions :These are same critical questioned related to strust framework as well as <strong>JAVA</strong> :<br /><br />1. What is green thread in Java ?<br />2. How final keyword differ from abstract ?<br />3. What is the order to write child and parent exception for same try block ?<br />4. How Java is open source ?<br />5. What are the property makes java a platform indepedent ?<br />6. Whether static class is possible ?<br />7. When a thread will come under deadlock condition ?<br />9. What is significance of <strong>public static void </strong>for the main() method in java ?<strong></strong><br />10. How Struts framework is better compared to spring ?<br />11. What is the difference between ArrayList and LinkList ?<br />12. What is the default size for a hashmap ?<br />13. What are the difference between a comparator and comparable interface ?<br />14. why global variable concept is not there in java ?<br /><br /><br /><strong>Here are some more on webtechnology ......</strong><br /><br />1. When cookies are harmfull...?<br />2. When a jsp file translated to a java file where actually it gets stored for tomcat , resin , JBoss servers ?<br />4. What is the maximum information a <strong>GET</strong> can carry ?<br />5. How struts handle client side validation ...?<br />6. Can we use thoes struts validator javascript methods in our own need in the same application ?<br />7. How client side validation can be enabled in struts ?<br />8. Where struts actually keeps the validator javascript methods and when these methods are generated ?<br />10. After request submission from a JSP page which method in struts framework basically decides the destinanation of the request ?<br />11. Which is better way to handle exception---within action class or in side the busines layer ?<br />12. How we can configure struts with spring ?<br />13. Point out one feature of struts which Spring framework doesnot has ?<br /><br /><br />Regards,<br />ZattyZATTYhttp://www.blogger.com/profile/03201161793771123940noreply@blogger.com1tag:blogger.com,1999:blog-808846258221817113.post-85948078639551337112009-05-09T02:59:00.000-07:002009-05-09T03:03:48.555-07:00Take some tutorial in J2MEtopic to discussed next :<br /><br /> <span style="color:#3333ff;"> 1. Java network enabling code .</span><br /><span style="color:#3333ff;"> 2. Struts validation .</span><br /><span style="color:#3333ff;"> 3. javascript for different browser .</span><br /><br /><strong>Regards ,</strong><br /><span style="color:#33ff33;">Zatty</span><br />Programmer in J2EE & SUN IDMZATTYhttp://www.blogger.com/profile/03201161793771123940noreply@blogger.com1