The first thing to solve is the abstraction from the db driver. The default Java approach of using DriverManager.getConnection does not work well in OSGi because of the classloading. It can be solved by offering and consuming the DataSource as an OSGI service.
Then the next thing is the setting up JPA. This is supported by Aries JNDI which allows to refer to the DataSource OSGi service using jndi inside your peristence.xml.
The last part of the puzzle is container managed persistence which is supported by aries JPA.
Below you can find a tutorial that shows all these concepts. The demo project examplejpa shows how it all works together.
http://liquid-reality.de/display/liquid/2012/01/13/Apache+Karaf+Tutorial+Part+6+-+Database+Access
https://github.com/cschneider/Karaf-Tutorial/tree/master/db/examplejpa