Not sure if there's a internal battery that looses power eventully but I've had the battery disconnected for a few hours with no ill effects.
If you remove the radio and put it in another JK or compatible vehicle, you would then need a code.I was told that if you disconnect the battery in a JK (it's a 2014), that the radio will require a code before it will function. Any truth to this?