Home » 2012 (page 18)

Yearly Archives: 2012

MyBatis Tutorial – CRUD Operations and Mapping Relationships – Part 1


CRUD Operations MyBatis is an SQL Mapper tool which greatly simplifies the database programing when compared to using JDBC directly.                   Step1: Create a Maven project and configure MyBatis dependencies.   <project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd'> <modelVersion>4.0.0</modelVersion> <groupId>com.sivalabs</groupId> <artifactId>mybatis-demo</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>mybatis-demo</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> ...

Read More »

Remote actors – discovering Akka


Assume our test application became a huge success and slowly a single server is not capable of handling growing traffic. We are faced with two choices: replacing our server with a better one (scaling up) or buying a second one and building a cluster (scaling out). We’ve chosen to build a cluster as it’s easier to scale in the future. ...

Read More »

Avoiding FORs – Anti-If Campaign


Have you ever wondered how FORs impact your code? How they are limiting your design and more important how they are transforming your code into an amount of lines without any human meaning? In this post we are going to see how to transform a simple example of a for (provided by Francesco Cirillio – anti-if campaign), to something more readable and well designed. ...

Read More »

Getting rid of null parameters with a simple spring aspect


What is the most hated and at the same time the most popular exception in the world? I bet it’s the NullPointerException. NullPointerException can mean anything, from simple “ups, I didn’t think that can be null” to hours and days of debugging of third-party libraries (try using Dozer for complicated transformations, I dare you). The funny thing is, it’s trivial ...

Read More »

Introduction to Enterprise Integration Patterns


In this blog entry we will go through some of Enterprise Integration Patterns. These are known design patterns that aims to solve integration challenges. After reading this one would get a head start in designing integration solutions. EIPs (in short) are known design patterns that provide solutions to issues/problems faced during application integration. The obvious question that comes to mind ...

Read More »

Making Plain Old Java OSGi Compatible


Although OSGi is increasingly popular in the Java world, there are many Java applications and libraries that have not been designed to work in OSGi. Sometimes you may need to run such code inside an OSGi environment, either because you would like to take advantage of the benefits offered by OSGi itself, or because you need certain features only offered ...

Read More »

JSON-Schema in WADL


In between other jobs I have been recently been reviewing the WADL specification with a view to fixing some documentation problems with a view to producing an updated version. One of the things that because apparent was the lack of any grammar support for languages other than XML – yes you can use a mapping from JSON<->XML Schema but this ...

Read More »

Iteratees for imperative programmers


When I first heard the word iteratee, I thought it was a joke. Turns out, it wasn’t a joke, in fact there are also enumerators (that’s ok) and enumeratees (you’re killing me). If you’re an imperative programmer, or rather a programmer who feels more comfortable writing imperative code than functional code, then you may be a little overwhelmed by all ...

Read More »

Tomcat Clustering Series Part 1 : Simple Load Balancer


I am going to start new series of posts about Tomcat clustering. In this post we will see what is the problem in normal deployment on a single machine, what is clustering and why is it necessary and how to setup a simple load balancer with Apache httpd web server + Tomcat server cluster. Why need Clustering? (Tomcat Clustering) In normal ...

Read More »

Simple Workflow Engine With Spring


Few months ago, during working on one of the company project, we had need to developed REST services which is used for sending an email depending on data sent by client application. During developing this service we decide to create simple workflow engine which will be charged for sending an email, but also this engine can be used for any ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.