I love error messages like these because its pretty clear what the problem is. In this case "UnsupportedOperationException" means your JDBC driver does not support this feature. Retrieving generated keys is NOT a standard feature nor is it supported by all drivers. Your only choices are to switch to a different driver (often there isn't one), switch to a different database (thats rarely an option), or find another way programmatically to deal with the problem. I actually wrote an article on this some time back: Database Key Generation in Java Applications