HI Jimmy.
If you want to do something what should access database, you have to open an environment. There is an easy way to do that things.
processEngine.execute(new Command() {
public Object execute(Environment env) {
// do any thing
return null;
}
});