fix CORE-1230

shutdown derby database depends on whether it is embedded or network
server
Merge pull request #105 from lcmatrix/CORE-1230

fix CORE-1230