Some DBs support "UPDATE OR INSERT" sort of statements. My suggestion would be to use a stored procedure for this, though. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057034#4057034 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057034