Archive for the ‘ Java ’ Category

Find rows with identical columns by SQL

adressbook

This is an article about how find rows in a table with one or more identical columns by SQL. The use case is to find entries in an account table with the same email address or with the same first name and surname. The trick is to join the table to itself.

Find all rows with the same email address:

SELECT left.*
FROM account left
INNER JOIN account right ON left.email = right.email
AND left.id != right.id;

Find all rows with the same first name and the same surname:

SELECT left.*
FROM account left
INNER JOIN account right ON left.firstname = right.firstname
AND left.name = right.name
AND left.id != right.id;

Deploy a Spring Boot Application to Pivotal Web Services

deployment

Spring Boot makes it easy to create stand-alone applications based on the Spring framework. Pivotal is the company behind the Spring framework. Pivotal is also running a cloud platform  called Pivotal Web Services (PWS). PWS provides a run time environment for several types of server based applications and PWS are particularly suitable for Spring Boot applications. If you are looking for a way to run your Spring Boot application „in the cloud“ take a look  at PWS. In this article I will show how to deploy a simple Spring Boot application in the  PWS environment.

Weiterlesen

Neo4j and JGraphT – A Perfect Team

Berlin_U-Bahn_S-Bahn

Neo4j is an open-source graph database, implemented in Java. JGraphT is a free Java graph library that provides mathematical graph-theory objects and algorithms. JGraphT is a well fitting data model for Neo4j query results as well as it provides a rich pool of algorithms to process it. This article is about how to get a JGraphT graph object as a result from a Neo4j Cypher query. In order to reach this goal, I started the project jgrapht-neo4j-client.

Weiterlesen

Query Neo4j with Cypher using the REST API

complete-graph

Neo4j REST API provides a way to query the database with Cypher. Cypher is a declarative graph query language. See the Neo4j manual to learn more about it. In this article I will show how to use the REST API to execute Cypher queries from Java code.

Weiterlesen

A REST web service, file uploads & Spring Boot

8ca7b37f78-arklein
In this article I will introduce a document archive application with a REST interface created with Spring Boot. You will find out how to handle file uploads by a REST web service. The web front end is created with AngularJS. The application is on GitHub. The impatient of you can follow this link to the repository: rest-document-archive to see the source code.

Weiterlesen

Import the knowledge of the world into Couchbase

320px-Wikidata-logo-en.svg

I have spend some time with Couchbase experiments again. The result is a tool which imports items from Wikidata: Wikidata-Couchbase-Importer (WCI) – GitHub repository.

Weiterlesen

Integrate Spring into JSF 2

There are many ways to integrate the Spring Framework into a JSF application. In this post I write about a tight integration in which almost all configuration is done with Spring annotations without loosing JSF bean handling in the front end. I have created an application template to show this approach. The project is hosted on GitHub (spring-jsf). In the end of the article you find a guide how to build and run this application.

Weiterlesen

Applet Animation – Part One: Display

Applet "Display" (screenshot)

The applet  you see in the screenshot I coded a long time ago. Applets are dead. I know. But this one is too nice to rest in peace.  Weiterlesen

Last.fm to Couchbase exporter

Last week I joined 33rd Degree Conference in Warsaw. One of my favorite talk was „Discover NoSQL Development with Couchbase 2.0“  from Tugdual GrallCouchbase is an open source NoSQL database.

After Tug’s workshop I started playing around with Couchbase. In this article I will describe my experiments.  Weiterlesen

Magisches Quadrat

S A T O R
A R E P O
T E N E T
O P E R A
R O T A S

Der Text ist Palindrom und magisches Quadrat: Er ist vorwärts und rückwärts, horizontal und vertikal gelesen immer gleich.