If you ever wanted to have a small, portable database that you could launch directly from the Java code, now you can do it – with HSQLDB! HSQLDB is written entirely in Java. To try it out, you will need just one file – hsqldb.jar which you will find in lib folder of the archive [...]
Type Safety: why would you need a Collections.checkedSet?
In one of the first posts on this blog I have discussed the problem of type checking (or lack of it) in some of Java collections even when using generics. Today I want to show you a similar issue that can break the type safety in your code. It’s a problem that can cause a [...]
Serialization to XML
We will show here a method to serialize an instance of a class to an XML file. We will use the java.beans package and contained there classes XMLEncoder and XMLDecoder.
First we need a class to serialize:
public class SerializeMe {
public Integer data;
public void setData(Integer data) {
[...]