The invention relates to a gene transfer-based method to protect a subject from diabetes or obesity. The method comprises administering to a salivary gland of the subject an AAV virion comprising an AAV vector that encodes an exendin-4 protein. Also provided are exendin-4 proteins and nucleic acid molecules that encode such exendin-4 proteins. Also provided are AAV vectors and AAV virions that encode an exendin-4 protein. One embodiment is an exendin-4 protein that is a fusion protein comprising an NGF secretory segment joined to the amino terminus of an exendin-4 protein domain.