Official documentation is a right place to start. Both frameworks have default support for JDBC persistence. This support consist of two things : DB schema and couple of beans responsible for persistence. What you need to do is provide your own implementations for these beans and then configure both frameworks to use your beans. You need to implement following interfaces :
- Spring Security : UserDetailsService
- Spring Social : ConnectionRepository
- Spring Social : UsersConnectionRepository
Check examples in the documentation, you'll find how to integrate your beans into frameworks. You will need additional beans if you want to use some features (like ACL in a case of Spring Security).