I have now sorted out my problem. I ended up going the proper route and using design patterns.
After posting here I found another post discussing the same problem and quoting http://www.theserverside.com/resources/patterns_review.jsp. I had a look at this and decided that if I was to do this at all, it should be properly done. I now have the sequence generator working and it does the job quite happily, even with multiple people (each running their own development jboss) accessing the same DB. Nice job!