you can use :String id = UUID.randomUUID().toString();if your project's jdk is 1.5 or you can use System.currentTimeMillis();