DOM Parser vs SAX Parser. Parse file XML kích thước lớn như thế nào?

Xem bài viết gốc tại: https://quan-cam.com/posts/parse-file-xml-lon Bài toán đặt ra Parse một file XML kích thước 10GB chứa thông tin kết quả tất cả các trận bóng đá trong lịch sử và ghi vào database. <?xml version=”1.0″ encoding=”UTF-8″ ?> <data> <match> <home_team> <id>1</id> <name>Germany</name> </home_team> <away_team> <id>2</id> <name>Brazil</name> </away_team> <result>7:1</result> </match> <match> <home_team> <id>3</id> <name>Vietnam</name> </home_team> […]

J2EE And SOA Architecture

In this article, you’ll learn how to design and develop service-oriented architecture (SOA) frameworks using the Java 2 Platform, Enterprise Edition (J2EE). By adapting an SOA framework, your organization can maximize loose coupling and reusability between systems. This article will take a high-level overview of several iterations over an SOA framework that will meet the needs of […]

MDB != JMS and vice-versa

Basics A Message Driven Bean (further referred to as MDB) is just another EJB like Stateless, Stateful or a Singleton. It’s specified using the @MessageDriven annotation. MDBs are used for asynchronous message processing They are similar to Stateless EJBs since both of them are pooled by the EJB container However they differ from Stateless EJBs […]

JEE – Frameworks for Layering reusable Architectures

The default overall enterprise framework of Java is called Java EE. Java EE strongly emphasis a layered architecture. It’s a quite large framework and learning every aspect of it can take some time. It supports several types of applications. Extremely small and simple ones may only use JSP files with some scriptlets, while larger ones […]

Avoid NullPointerException in Java

I would like to share with you some tips to deal/prevent NPE in your code: The BIG IMPORTANT rule: do NOT assign / pass / return null value and keep your code as cohesive as possible. Programming tips / techniques: 1. Return an empty collections instead of null. For example: List: Set: Map: 2. Return […]