Input Validation Failures: Input should be validated both at the client end and the server end (before any processing). Validating both from trusted and untrusted sources is important. Otherwise code injection attack may happen. Validation should include: data type (string, integer), format, length, range, null-value handling, verifying for character-set, locale, patterns, context, legal values and …
Category: FromSitesTree.com
Jul 18
Java: Common Architectures #Java Short Notes
Common Architectures Two tier architectures Three tier architectures Multi-tier architectures Rich clients and browser-based clients in respect of Java EE applications Web Services From: http://sitestree.com/?p=4890 Categories:Java Short NotesTags: Post Data:2010-06-02 07:22:23 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/ …
Jul 18
Java Collection Framework #Java Short Notes
Array Benefits Constraints Data access is fast. Good for ordered data, which is not changed or searched frequently. Inefficient if number of elements grow. Inefficient if an element to be inserted in middle of collection. Provides no special search mechanism. Linked List Benefits Constraints Allows efficient inserts/delete at any location Allows arbitrary growth of collection. …
Jul 18
Code Conventions for the Java Programming Language #Java Short Notes
Why Have Code Conventions? 80% of software life cycle is spent on software maintenance. Hardly the original author maintains a software Code Conventions improve the readability of the software If you require to ship your source code as a product, code conventions make your product well packaged Java Code Conventions Avoid assigning several variables to …
Jul 18
Sun certifications: Topics #Java Short Notes
Enterprise Architect Business Component Developer Web Component Developer Sun Certified Developer for Java Web Services Mobile Application Developer From: http://sitestree.com/?p=4885 Categories:Java Short NotesTags: Post Data:2008-10-21 15:25:38 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
Jul 18
EJB 3: Entity Bean Basic #Java Short Notes
Plain Java objects with persistence storage. They are not remotable and must be accessed through the new javax.persistence.EntityManager service. An entity bean implementation is provided in the following three files/classesBeansOrder.javaLineItem.javaEntity ManagerShoppingCartBean.java//Order.javaimport javax.persistence.CascadeType;import javax.persistence.Entity;import javax.persistence.FetchType;import javax.persistence.GeneratedValue; import javax.persistence.GenerationType;import javax.persistence.Id;import javax.persistence.OneToMany;import javax.persistence.Table;import javax.persistence.Id;import javax.persistence.CascadeType;import javax.persistence.FetchType;import java.util.ArrayList;import java.util.Collection;@Entity@Table(name = “PURCHASE_ORDER”)public class Order implements java.io.Serializable{ private int id; private …
Jul 18
Comparison EJB 2 and EJB 3 #Java Short Notes
Comparison EJB 2 and EJB 3 EJB 2.0 has deployment descriptors but EJB 3.0 has no deployment descriptor In EJB 2.0 you have to write Home and Remote Interfaces But in EJB3.0 you do not need to write Home interfaces In EJB 3.0, all entities are identified with ‘@’ In EJB 3.0 methods like ejbPassivate, …
Jul 18
JDBC: Stored Procedure #Java Short Notes
Sample stored procedure call using JDBC:Call stored procedure to change/set a value in the database//set birthday – supply professor nametry{ String professor= “dylan thomas”; CallableStatement proc = connection.prepareCall(“{ call set_birth_date(?, ?) }”); proc.setString(1, professor); proc.setString(2, ‘1950-01-01’); cs.execute();}catch (SQLException e){ // ….}Stored procedures can also return result/data to the caller: like//return birth dayconnection.setAutoCommit(false);CallableStatement proc = connection.prepareCall(“{ …
Jul 17
EJB 3: Statefull EJB #Java Short Notes
States need to be maintained between calls. In EJB3 all beans are homeless [no home interface]//ShoppingCartBean.javaimport java.io.Serializable;import java.util.HashMap;import javax.ejb.Remove;import javax.ejb.Stateful;import javax.ejb.Remote;@Stateful@Remote(ShoppingCart.class)public class ShoppingCartBean implements ShoppingCart, Serializable{ private HashMap cart = new HashMap(); public void buy(String product, int quantity) { if (cart.containsKey(product)) { int currq = cart.get(product); currq += quantity; cart.put(product, currq); } else { cart.put(product, …
Jul 17
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 …
