Added sql exception handling to rollback and close connection.