Touch up select() exception type
Catch more SQL exceptions, and try to deal with them in a better way.