This is done through your DarkRP configuration. More specifically inside the darkrpmodification folder.
If you don't know what darkrpmodification is then please find it here https://github.com/FPtje/darkrpmodification
File location: darkrpmodification/lua/darkrp_config/settings.lua
Go to line 321 and find table GM.Config.DisallowDrop
The name of the jackhammer weapon is ch_mining_jackhammer
Add it to the table as you can see the other weapons are added and you're done!