What is Spring Framework? What does it mean to J2EE developers #Java Short Notes

What is Spring Framework? What does it mean to J2EE developers?

Spring is a light-weight framework, very often referred as an alternative/competitor to EJB, for the development of enterprise-type applications.

Spring provides many features such as declarative transaction management, access to remote logic using RMI or web services, mailing facilities and

database abstraction.

Features of Spring Framework

  1. Transaction Management: A generic abstraction layer for transaction management that removes low-level interactions
  2. JDBC Exception Handling: An exception hierarchy to simplify the error handling strategy
  3. Integration with Hibernate, JDO, and iBATIS
  4. AOP Framework: Aspect Oriented Programming Framework
  5. MVC Framework: Spring provides MVC web application framework built on core Spring functionality

Spring Architecture

  1. Spring AOP: Provides declarative enterprise services such as declarative transaction management
  2. Spring ORM: Provides integration layers for object-relational mapping APIs, including JDO, Hibernate and iBatis for database access.
  3. Spring Web: Provides web application development stack that includes Spring MVC.
  4. Spring DAO: Provides standardization to data access using the technologies like JDBC, Hibernate or JDO.
  5. Spring Context: Provides support for using message sources, and resources. It is based on Java bean.
  6. Spring Web MVC: Provides MVC for web applications.
  7. Spring Core: Provides Dependency Injection features

From: http://sitestree.com/?p=4828
Categories:Java Short Notes
Tags:
Post Data:2007-09-08 00:28:07

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Unit Testing in Eclipse for Java #Java Short Notes

Unit Testing in Eclipse for Java: just an overview

Why Unit Test?

Say, you have written some Java classes, before making use of them in real application functionalities, it’s always better to check whether the classes (their functions/methods) are working properly. Unit tests simply test a single unit like a single class, or a single function at a time. It’s almost always a good practice to design the software first, also design the classes and their methods along with interactions among classes, early in the project. After, classes and their methods are written, you should do some testing to make sure they are working properly.

How to Unit test in Eclipse?

1. You need to add junit.jar in your project build path. You can do that by selecting the project, then right click, then select properties, the java build path, then libraries tab, and then add jars/add external jars and select JUnit.jar.

2. You can create a folder to keep your unit test codes say unittestcodes.

3. The basic idea is, to test a class, you will need to create a test case class with methods like setUp, tearDown, and test methods for all the methods that you want to test (one for one). The setUp() method can be used to create the data for testing [you have to write the code though]. The other test methods will call the corresponding class methods using the data to check if the methods are working properly or not. Methods like assertTrue may come handy in the test methods.

4. How to create these test classes and test methods?

Right click the folder for testcode like unittestcodes, select new, select other, type Junit in the text box, select Junit test case…and then provide other parameters like the name of your test class, which class do you want to test, do you want to have setUp(), tearDown() methods or not?. In the next step, you have to select which methods of the class you want to test. Then the test class (skeleton) will be written for you.

5. In the setUp() method, write code to build test data. From the other test methods call the related class methods to test them.

6. How to run the experiment: right click the name of this test class from the left window, select run as, select Junit test case. Now analyze the output and fix the class methods if required. Try with different data, data from different ranges, boundary value data and you know what to test in your use cases. From: http://sitestree.com/?p=4821
Categories:Java Short Notes
Tags:
Post Data:2007-03-28 00:33:28

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

How to upload data from an excel file to database using servlets? #Java Short Notes

Use third party API bundles like jexcelApi.
http://jexcelapi.sourceforge.net/.


create an XML file to define the structure of your excel file like how many columns, column names, corresponding database table/class column/variable name,

Create a Java class that can retrieve information from that xml file. You can use XPATH and DOM for the purpose. check http://www.ibm.com/developerworks/library/x-javaxpathapi.html for ideas


write an html form that use input type=’file’, the form action should point to the servlet that will collect data from the excel file and store it in the database. servlet will collect data from the input stream

———–
in the servlet use the class that represents the xml file. to get information about the file that will help mapping the excel file data to the corresponding table column. You can also create a class representing the database table. From servlet extract data, create an object of table class type, and create a function that takes the object and inserts into the table.

—————
How servlet will process the excel file:

jexcelAPI Workbook class represents the total workbook
use getsheet method of workbook class to get the sheet number 0,1,2….

use getCell method of worksheet to get a particular cell object in the excel file
use getContents on the cell object to get data in string type.

from the XML file having excel file structure, you can get number of columns in the file. So you can write a look that will read data row,column wise from the excel file

—-
code to process excel file [in servlet]

Workbook workbook = Workbook.getWorkbook(new File(“myfile.xls”));

Sheet sheet = workbook.getSheet(0);

Cell a1 = sheet.getCell(0,0);

Cell b2 = sheet.getCell(1,1);

Cell c2 = sheet.getCell(2,1);

String stringa1 = a1.getContents();

String stringb2 = b2.getContents();

String stringc2 = c2.getContents();

———————-

check the following webpage, it provides file upload and extract data from input stream in servlet applications

http://jexcelapi.sourceforge.net/resources/faq/

From: http://sitestree.com/?p=4801
Categories:Java Short Notes
Tags:
Post Data:2011-07-14 06:40:06

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Linked List and Iterator in Java #Java Short Notes

/* * LinkedList.java * * Created on January 10, 2008, 8:51 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */package linkedlist;import java.util.List;import java.util.LinkedList;import java.util.Iterator;import java.util.ListIterator;import java.util.Collections;import java.util.Random;/** * * @author Sayed */public class LinkedListTest {        /** Creates a new instance of LinkedList */    public LinkedListTest() {    }        /**     *Example operations using linked lists     */        public void linkedListOperation(){                final int MAX = 10;        int counter = 0;        //create two linked lists        List listA = new LinkedList();        List listB = new LinkedList();        //store data in the linked list A        for (int i = 0; i < MAX; i++) {            System.out.println("  - Storing Integer(" + i + ")");            listA.add(new Integer(i));        }               //print data from the linked list using iterator         Iterator it = listA.iterator();        while (it.hasNext()) {            System.out.println(it.next());        }        //print data from the linked list using listIterator.         counter = 0;        ListIterator liIt = listA.listIterator();        while (liIt.hasNext()) {            System.out.println("Element [" + counter + "] = " + liIt.next());            System.out.println("  - hasPrevious    = " + liIt.hasPrevious());            System.out.println("  - hasNext        = " + liIt.hasNext());            System.out.println("  - previousIndex  = " + liIt.previousIndex());            System.out.println("  - nextIndex      = " + liIt.nextIndex());            System.out.println();            counter++;        }        //retrieve data from the linked list using index        for (int j=0; j < listA.size(); j++) {            System.out.println("[" + j + "] - " + listA.get(j));        }        //find the location of an element        int locationIndex = listA.indexOf("5");        System.out.println("Index location of the String "5"" is: "" + locationIndex);          //find the first and the last location of an element        System.out.println(""First occurance search for String ""5"".  Index =  "" + 		listA.indexOf(""5""));        System.out.println(""Last Index search for String ""5"".       Index =  "" + 		listA.lastIndexOf(""5""));        //create a sublist from the list         List listSub = listA.subList(10

From: http://sitestree.com/?p=4788
Categories:Java Short Notes
Tags:
Post Data:2013-04-04 09:12:30

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

MVC : Struts : Java : Industry Web Application #Java Short Notes

Industries use frameworks for application development quite often. For example: Java concepts like JSP, Servlet, Swing, Bean, JDBC can be used directly to create web-applications but when such applications become big, it becomes difficult to maintain and develop them further. Hence, frameworks like struts are used to develop large web-based Java applications. This makes maintenance and further development easier. If you need to write a very simple web application with a few pages, then you might consider using JSP/Servlet directly otherwise Struts like frameworks are better options.Struts-1 uses the concept Model View Architecture (MVC) and provides the controller. In MVC model, Model represents business logic, View represents user interfaces, and Controller represents/controls control flow of the application. Struts' control layer is based on standard technologies like Java Servlets, JavaBeans, ResourceBundles, and XML, as well as various Apache Commons  packages, like BeanUtils and Chain of Responsibility. For the Model,  struts-1 framework can interact with standard data access technologies, like JDBC  and EJB,  as well as most any third-party packages, like Hibernate,  iBATIS,  or Object Relational Bridge.  For the View,  the framework works well with JavaServer Pages,  including JSTL and JSF,  as well as  Velocity Templates,  XSLT,  and other presentation systems.The framework's Controller acts as a bridge between the application's Model and the web View. When a request is received, the Controller invokes an Action  class. The Action class consults with the Model to examine or update the application's state. The framework provides an ActionForm  class to help transfer data between Model and View.Struts-1 Configuration-----------------------web.xml is one of the configuration files. It is an XML-formatted file that works as a deployment descriptor. struts-config.xml is another resource file to initialize the applications resources. These resources include  ActionForms  to collect input from users,  ActionMappings  to direct input to server-side  Actions,  and ActionForwards to select output pages.Sample struts-config.xml file.                                                                                                                                                                                        Other resources like Validators can be initialized here.

From: http://sitestree.com/?p=4787
Categories:Java Short Notes
Tags:
Post Data:2010-03-13 02:59:40

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Java XML Example – XML File Parse and Use Attributes #Java Short Notes

From: http://sitestree.com/?p=4776
Categories:Java Short Notes
Tags:
Post Data:2009-07-22 04:37:22

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Opening and reading files with Java JDK 1.0.x #Java Short Notes

   1. Open the file with the File class;   2. Create a FileInputStream object using the File object;   3. Convert the FileInputStream to a BufferedInputStream to greatly increase file reading speed;   4. Convert the BufferedInputStream to a DataInputStream; the methods of DataInputStream        give a fair amount of flexibility in        reading the data.   5. Read the file until the endFile f = new File("mydata.txt"); FileInputStream fis = new FileInputStream(f); BufferedInputStream bis = new BufferedInputStream(fis); DataInputStream dis = new DataInputStream(bis);  String record = null; try {    while ( (record=dis.readLine()) != null ) {       //       // put your logic here to work with "record"       //    } } catch (IOException e) {    //    // put your error-handling code here    // } 

From: http://sitestree.com/?p=4775
Categories:Java Short Notes
Tags:
Post Data:2007-12-31 19:48:19

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

#Engineering: #Canada: #Job/Contract/Project: Any #Engineering: #Computer, #Electrical, #Electronics, #Civil, #Chemical, #Mechanical, #Naval, #Biomedical, and misc Engineering

Date Posted:2021-07-17 .Apply yourself, or submit others as candidates; Build a recruitment team to submit others as candidates; submit RFP to be considered for projects in future; Try to become a vendor so that you are asked to submit consultants/resources in future. If these work for you. This list is posted in this blog everyday provided there are new projects under the criteria

  1. construction-services-10004
  2. REGINA SOUTH SWITCHING STATION – CIVIL WORKS
  3. ET Kenney Electrical Upgrades
  • electrical-and-electronics-10006
  • Electrical Products (Door Locks) (W3330-22-111)
  • Electrical Wire Products
  • Fleet Lighting and Electrical Components
  • transportation-equipment-and-spares-10029
  • Fleet Lighting and Electrical Components
  • architect-and-engineering-services-10048
  • Install Doorway to Mechanical Pit for Elevator Maintenance
  • If & As Required Geotechnical Engineering Review Services
  • Professional Engineering Services – Street Reconstruction No. 4
  • Project Electrical Engineer- Peak Shavers NF 91 Project
  • RQQ-2020-NAFA-487: Engineering Services for Mount Joy Passing Track
  • Engineering Services-Brown Street, Sydney Mines-Waterline Upgrade
  • Engineering Services, CS 2-20 Twinning, North of Prince Albert
  • Engineering Design and Contract Admin Services for Riverside Lift Station
  • environmental-services-10050
  • If & As Required Geotechnical Engineering Review Services
  • Prime Consultant Landscape Architecture or Civil Engineering Consultant Services for David Thompson Corridor Infrastructure Safety Upgrades
  • natural-resources-services-10051
  • SP22TED251 – Mechanical Site Preparation – Excavator – Kamloops
  • Mechanical Site Preparation – Excavator – Kamloops Field Team
  • operation-of-government-owned-facilities-10039
  • Engineering Services for Intersection Improvement Program
  • professional-administrative-and-management-support-services-10040
  • If & As Required Geotechnical Engineering Review Services
  • Engineering Advanced Design Gap Analysis Consulting Services
  • research-and-development-r-d-10036
  • Software reverse engineering prototypes development (W7701-217332/A)
  • Engineering Services for Intersection Improvement Program
  • special-studies-and-analysis-not-r-d-10047
  • Engineering and Architectural Services
  • undefined-10055
  • RQQ-2020-NAFA-487: Engineering Services for Mount Joy Passing Track
  • Keywords Used:engineer,civil,mechanical,electrical,electronics,mechatronics,naval,biomedical,computer engineer,software engineer,civil engineer,biomedical,electrical engineer,electronics engineer,mechanical engineer,metallurgical,chemical engineer,industrial engineer,communications engineer,quality assurance engineer,Aerospace engineer,aeronautical engineer,Engineering manager,Agricultural Engineer,Automotive Engineer,Environmental Engineer,Geological Engineer,Marine Engineer,Petroleum Engineer,Acoustic Engineer,Acoustic Engineer,Aerospace Engineer,Agricultural Engineer,Applied Engineer,Architectural Engineer,Audio Engineer,Automotive Engineer,Biomedical Engineer,Chemical Engineer,Civil Engineer,Computer Engineer,Electrical Engineer,Environmental Engineer,Industrial Engineer,Marine Engineer,Materials Science Engineer,Mechanical Engineer,Mechatronic Engineer,Mining and Geological Engineer,Molecular Engineer,Nanoengineering,Nuclear Engineer,Petroleum Engineer,Software Engineer,Structural Engineer,Telecommunications Engineer,Thermal Engineer,Transport Engineer,Vehicle Engineer,engineering

    #Canada: #IT Jobs:#Consultants, #Contractors, #Analysts, #Engineers, #Developers, #Technology Consultants, #IT-Consultants Opportunities2021-07-17

    Apply yourself, or submit others as a candidate, Build a recruitment team to submit others as a candidate, submit RFP to be considered for projects in future, Try to become a vendor so that you are asked to submit consultants/resources in future

    1. edp-hardware-and-software-10034
    2. Project: tender_15205 – 21-004P Cloud-Based Web Services
    3. energy-10007
    4. Source List (SL) for Environmental Consulting Services
    5. Prime Consultant for Main Building Foundation Repairs & Site Grading
    6. architect-and-engineering-services-10048
    7. Consulting Services: Archibald Drive Storm Sewers
    8. communications-photographic-mapping-printing-and-publication-services-10042
    9. Environmental and Survey Consultant Services for Highway-774 Wildlife Road Crossing Study and Fence Line Survey
    10. educational-and-training-services-10043
    11. Assessment Consulting Service for the Assured Income for the Severely Handicapped (AISH) Program for the Province of Alberta
    12. Anti-Racism & Anti-Discrimination Exploratory Working Group (AREWG) Consultant
    13. environmental-services-10050
    14. Environmental and Survey Consultant Services for Highway-774 Wildlife Road Crossing Study and Fence Line Survey
    15. Prime Consultant Landscape Architecture or Civil Engineering Consultant Services for David Thompson Corridor Infrastructure Safety Upgrades
    16. financial-and-related-services-10038
    17. Group Insurance Consulting (EP899-220446/A)
    18. RQQ-2020-FACA-499: VOR + 2nd Stage- Provide Accounting & Tax Consulting Services
    19. Request for Proposal (RFP) for Actuarial and Pension Consulting Services
    20. information-processing-and-related-telecommunications-services-10049
    21. Project: tender_15205 – 21-004P Cloud-Based Web Services
    22. REFONTE DES SITES WEB
    23. professional-administrative-and-management-support-services-10040
    24. Engineering Advanced Design Gap Analysis Consulting Services
    25. Prime Consultant Services for Brantford Police Services Headquarters Retrofit and Expansion
    26. special-studies-and-analysis-not-r-d-10047
    27. CONSULTING SERVICES FOR STREETSCAPE ASSESSMENT
    28. Anti-Racism & Anti-Discrimination Exploratory Working Group (AREWG) Consultant
    29. Consulting Services – Construction Material Salvage & Recycling Market Assessment
    30. #Sensor: #Canada: #Job/Contract/Project: #Sensor, #Tracking, #Fusion, #Estimation, #Surveillance, #sensor network, #target #tracking, #security 2021-07-17

      Date Posted:2021-07-17 .Apply yourself, or submit others as candidates; Build a recruitment team to submit others as candidates; submit RFP to be considered for projects in future; Try to become a vendor so that you are asked to submit consultants/resources in future. If these work for you. This list is posted in this blog everyday provided there are new projects under the criteria

      1. armament-10027
      2. Signal Smoke Marine, Orange (W8486-217390/A)
      3. communications-detection-and-fibre-optics-10031
      4. LEED Recognition Display
      5. construction-products-10032
      6. LEED Recognition Display
      7. electrical-and-electronics-10006
      8. LEED Recognition Display
      9. Surveillance of Space 2 RFI (W8474-187639/C)
      10. fire-fighting-security-and-safety-equipment-10010
      11. Smart Anti-Loitering and Security System
      12. textiles-and-apparel-10028
      13. LEED Recognition Display
      14. architect-and-engineering-services-10048
      15. RFP – Building Perimeter – Access Point Security
      16. communications-photographic-mapping-printing-and-publication-services-10042
      17. LEED Recognition Display
      18. custodial-operations-and-related-services-10037
      19. LEED Recognition Display
      20. environmental-services-10050
      21. LEED Recognition Display
      22. information-processing-and-related-telecommunications-services-10049
      23. LEED Recognition Display
      24. research-and-development-r-d-10036
      25. ITS Operational Security Services
      26. utilities-10041
      27. LEED Recognition Display
      28. Keywords Used:sensor,fusion,sensor network,tracking,target tracking,surveillance,self driving car,self-driving,estimation,security,signal processing,image processing,autonomouse vehicle,facial recognition,signal,recognition,sensor fusion