You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by "Craig S. Dickson" <cr...@craigsdickson.com> on 2012/05/31 00:25:09 UTC

Connecting to a JDBC DB from Sling

Hi,

As part of a pure Sling application (ie. not CQ etc) I need to connect to a JDBC DB from my code (could be straight JDBC, might include Hibernate etc). The database contains business data, not content.

In a "traditional" web app, I would probably use JNDI to look up a JDBC DataSource object under a pre-defined name. This way specific connection details, including security credentials are abstracted out of my code.

Is there a Sling equivalent to this, or any best practices that anyone can recommend?

I googled around a little, but most of the Sling + JDBC hits are to do with persistence managers for the JCR repo which is not my use case.

Thanks in advance,

Craig


==========================
Craig S. Dickson
Independent Consultant
http://craigsdickson.com
http://www.linkedin.com/in/craigsdickson





Re: Connecting to a JDBC DB from Sling

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Craig,

On Thu, May 31, 2012 at 7:01 PM, Craig S. Dickson
<cr...@craigsdickson.com> wrote:
> ...I want to refactor my code so that the Connections are managed externally
> to my code instead of creating them myself. That way the details of the actual
> connection are all removed from my source code...

Starting from the commons.dbcp example at [1] you should be able to
create an OSGi service that's configured by a JDBC URL and an
arbitrary DataSource name that maps to it, and provides a
getDataSource(name) method that returns a  javax.sql.DataSource.

The dbcp pool will then (AFAIK) manage connections correctly. And if
you need several data sources, make your service a service factory.
That's pretty much how we handle it in the CQ module that you mention.

-Bertrand

[1] http://svn.apache.org/repos/asf/commons/proper/dbcp/trunk/doc/PoolingDataSourceExample.java

Re: Connecting to a JDBC DB from Sling

Posted by Sarwar Bhuiyan <sa...@gmail.com>.
I'm pretty sure you can find some make or find some osgi bundle which
implements a set of connection pools.  That's the way it's done in CQ5.
 Then basically, you can create instances of the pool in Felix which is
accessible by the PID of the pool service.

Sarwar

On Thu, May 31, 2012 at 6:01 PM, Craig S. Dickson
<cr...@craigsdickson.com>wrote:

> Thanks Bertrand and Sarwar.
>
> My original post didn't mention it, but I do actually have a prototype up
> and running making simple JDBC connections from within an OSGI component,
> so I have the mechanics of loading drivers and making a connection working
> already.
>
> The main problem with the prototype (and the reason for this thread) is
> that I currently pass the JDBC URL and username and password to the OSGI
> component via OSGI properties. In the activate method for the component I
> read in the properties and create a Connection to the database, which I
> then hold onto until the deactivate method is called. This is fine for the
> prototype but is really horrible for a production environment for a couple
> of main reasons:
>
> - too much scaffolding code in my component about loading a driver and
> creating connections
> - the database information is not easily shareable with other components
> that also need to access the same database
> - holding on to a connection for the life of the component is a really bad
> idea from a system resource perspective
>
> So basically I want to refactor my code so that the Connections are
> managed externally to my code instead of creating them myself. That way the
> details of the actual connection are all removed from my source code. This
> would also allow other Components to make use of the same
> DataSource/Connections including possible connection pooling etc. So like I
> said in the original email, if this was a traditional web app, I would
> achieve these goasl by defining a container managed DataSource object and
> making it available to my application via JNDI lookups. My question is - is
> there a standard "sling" way of doing something similar (not necessarily
> using JNDI), or if not, what have people done in their own code to achieve
> similar goals?
>
> FWIW, in CQ they have addressed this issue as detailed here:
>
> http://dev.day.com/content/kb/home/cq5/Development/HowToConfigureSlingDatasource.html
>
> I am not using CQ though for this current project, so I am working with
> just the standard Sling APIs.
>
> Thanks
>
>
>
>
> On May 31, 2012, at 2:54 AM, Bertrand Delacretaz wrote:
>
> > Hi,
> >
> > On Thu, May 31, 2012 at 12:25 AM, Craig S. Dickson
> > <cr...@craigsdickson.com> wrote:
> >> ...In a "traditional" web app, I would probably use JNDI to look up a
> JDBC
> >> DataSource object under a pre-defined name. This way specific connection
> >> details, including security credentials are abstracted out of my code.
> >>
> >> Is there a Sling equivalent to this, or any best practices that anyone
> can
> >> recommend?...
> >
> > IMO the basic problems are:
> >
> > 1) Making your JDBC driver's classes visible to bundles that use them
> >
> > 2) Making sure the driver is registered with the JDBC subsystem
> >
> > For 1) you can use an OSGified driver that exports the appropriate
> > packages, and optional or dynamic import packages in the bundles that
> > need them (which is hopefully just one or a few bundles, otherwise you
> > might need a more complex setup).
> >
> > For 2) you might use an Activator in the OSGified driver bundle, that
> > creates an instance of the driver to have it registered.
> >
> > There's an example of that at [0].
> >
> > I think you should be able to get that working without resorting to
> > complex tools, at least with basic JDBC. Hibernate might be a pain to
> > use in OSGi, I haven't dared to try that.
> >
> > -Bertrand
> >
> > [0] http://hwellmann.blogspot.com/2009/04/jdbc-drivers-in-osgi.html
>
>

Re: Connecting to a JDBC DB from Sling

Posted by "Craig S. Dickson" <cr...@craigsdickson.com>.
Thanks Bertrand and Sarwar.

My original post didn't mention it, but I do actually have a prototype up and running making simple JDBC connections from within an OSGI component, so I have the mechanics of loading drivers and making a connection working already.

The main problem with the prototype (and the reason for this thread) is that I currently pass the JDBC URL and username and password to the OSGI component via OSGI properties. In the activate method for the component I read in the properties and create a Connection to the database, which I then hold onto until the deactivate method is called. This is fine for the prototype but is really horrible for a production environment for a couple of main reasons:

- too much scaffolding code in my component about loading a driver and creating connections
- the database information is not easily shareable with other components that also need to access the same database
- holding on to a connection for the life of the component is a really bad idea from a system resource perspective

So basically I want to refactor my code so that the Connections are managed externally to my code instead of creating them myself. That way the details of the actual connection are all removed from my source code. This would also allow other Components to make use of the same DataSource/Connections including possible connection pooling etc. So like I said in the original email, if this was a traditional web app, I would achieve these goasl by defining a container managed DataSource object and making it available to my application via JNDI lookups. My question is - is there a standard "sling" way of doing something similar (not necessarily using JNDI), or if not, what have people done in their own code to achieve similar goals?

FWIW, in CQ they have addressed this issue as detailed here:
http://dev.day.com/content/kb/home/cq5/Development/HowToConfigureSlingDatasource.html

I am not using CQ though for this current project, so I am working with just the standard Sling APIs.

Thanks




On May 31, 2012, at 2:54 AM, Bertrand Delacretaz wrote:

> Hi,
> 
> On Thu, May 31, 2012 at 12:25 AM, Craig S. Dickson
> <cr...@craigsdickson.com> wrote:
>> ...In a "traditional" web app, I would probably use JNDI to look up a JDBC
>> DataSource object under a pre-defined name. This way specific connection
>> details, including security credentials are abstracted out of my code.
>> 
>> Is there a Sling equivalent to this, or any best practices that anyone can
>> recommend?...
> 
> IMO the basic problems are:
> 
> 1) Making your JDBC driver's classes visible to bundles that use them
> 
> 2) Making sure the driver is registered with the JDBC subsystem
> 
> For 1) you can use an OSGified driver that exports the appropriate
> packages, and optional or dynamic import packages in the bundles that
> need them (which is hopefully just one or a few bundles, otherwise you
> might need a more complex setup).
> 
> For 2) you might use an Activator in the OSGified driver bundle, that
> creates an instance of the driver to have it registered.
> 
> There's an example of that at [0].
> 
> I think you should be able to get that working without resorting to
> complex tools, at least with basic JDBC. Hibernate might be a pain to
> use in OSGi, I haven't dared to try that.
> 
> -Bertrand
> 
> [0] http://hwellmann.blogspot.com/2009/04/jdbc-drivers-in-osgi.html


Re: Connecting to a JDBC DB from Sling

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Thu, May 31, 2012 at 12:25 AM, Craig S. Dickson
<cr...@craigsdickson.com> wrote:
> ...In a "traditional" web app, I would probably use JNDI to look up a JDBC
> DataSource object under a pre-defined name. This way specific connection
> details, including security credentials are abstracted out of my code.
>
> Is there a Sling equivalent to this, or any best practices that anyone can
> recommend?...

IMO the basic problems are:

1) Making your JDBC driver's classes visible to bundles that use them

2) Making sure the driver is registered with the JDBC subsystem

For 1) you can use an OSGified driver that exports the appropriate
packages, and optional or dynamic import packages in the bundles that
need them (which is hopefully just one or a few bundles, otherwise you
might need a more complex setup).

For 2) you might use an Activator in the OSGified driver bundle, that
creates an instance of the driver to have it registered.

There's an example of that at [0].

I think you should be able to get that working without resorting to
complex tools, at least with basic JDBC. Hibernate might be a pain to
use in OSGi, I haven't dared to try that.

-Bertrand

[0] http://hwellmann.blogspot.com/2009/04/jdbc-drivers-in-osgi.html

Re: Connecting to a JDBC DB from Sling

Posted by Sarwar Bhuiyan <sa...@gmail.com>.
Hi Craig,

This is more an OSGi question than a Sling question.  A simple thing you
can do is to install a bundle containing the JDBC Driver.  Maybe an
osgified bundle already exists or you can convert the jar to an osgi bundle
with the right packages for the driver exposed.  Then the next step is to
load the driver and use it.  Not sure if there are any classloader
complications here.

There are other approaches with more layers on top of JDBC.  You could look
up how to use JPA with EclipseLink on OSGi.  That would still involve
installing the driver bundle, the JPA bundle, and EclipseLink bundle.  But
with that, you can write your entity classes with the JPA annotations and
as long as you configure persistence.xml which registers the JPA entities
and the entity manager.  Then any consuming application needs to use the
entity manager to get or save to the db.  I don't have any links handy but
I suppose a little googling would provide.

Hope this helps somewhat.

Sarwar

On Thu, May 31, 2012 at 9:01 AM, Craig S. Dickson
<cr...@craigsdickson.com>wrote:

> HI Justin,
>
> Thanks for the link to Aries.
>
> My initial thought though is that Aries feels a little like a sledgehammer
> and my problem is just  a walnut. I do see how Aries could be used to
> provide a JNDI context in an OSGI world, but I am not necessarily tied to
> using JNDI, I just mentioned it as part of a common pattern demonstrated by
> "traditional" web apps.
>
> Is JNDI (via Aries etc) still the way to go in a Sling application, or is
> there a more "sling" way to achieve the same idea (ie. define a shared
> resource that can be obtained at runtime)? To me, this smells a little like
> the OSGI service model, where you might look for a service providing the
> JDBC DataSource interface and that also had some name property defined on
> it with the value you are looking for, but I am not sure if I am going down
> the wrong path.
>
> Thanks
>
>
>
>
> On May 30, 2012, at 3:31 PM, Justin Edelson wrote:
>
> > Hi Craig,
> > Have you looked at the OSGi enterprise specs and Apache Aries? That'd be
> a good place to start.
> >
> > Justin
> >
> > On May 30, 2012, at 6:25 PM, "Craig S. Dickson" <cr...@craigsdickson.com>
> wrote:
> >
> >> Hi,
> >>
> >> As part of a pure Sling application (ie. not CQ etc) I need to connect
> to a JDBC DB from my code (could be straight JDBC, might include Hibernate
> etc). The database contains business data, not content.
> >>
> >> In a "traditional" web app, I would probably use JNDI to look up a JDBC
> DataSource object under a pre-defined name. This way specific connection
> details, including security credentials are abstracted out of my code.
> >>
> >> Is there a Sling equivalent to this, or any best practices that anyone
> can recommend?
> >>
> >> I googled around a little, but most of the Sling + JDBC hits are to do
> with persistence managers for the JCR repo which is not my use case.
> >>
> >> Thanks in advance,
> >>
> >> Craig
> >>
> >>
> >> ==========================
> >> Craig S. Dickson
> >> Independent Consultant
> >> http://craigsdickson.com
> >> http://www.linkedin.com/in/craigsdickson
> >>
> >>
> >>
> >>
>
>

Re: Connecting to a JDBC DB from Sling

Posted by Marius Giepz <ma...@t-online.de>.
Not sure if that is what you want, but i usually publish a datasource 
via blueprint (aries) like:

<bean id="dataSource" class="org.hsqldb.jdbc.jdbcDataSource">
<property name="database" 
value="jdbc:hsqldb:hsql://localhost:9001/foodmart" />
<property name="user" value="sa" />
<property name="password" value="" />
</bean>

<service interface="javax.sql.DataSource" ref="dataSource">
<service-properties>
<entry key="osgi.jndi.service.name" value="foodmart" />
</service-properties>
</service>

     and in the bundle that uses it, i look up the service like

         ServiceReference[] dsRefs = 
bundleContext.getServiceReferences(DataSource.class.getName(), null);
         for (ServiceReference ref : dataSources) {
             String jndiName = getJndiName(ref);
             if (name.equals(jndiName)) {
                 DataSource ds = (DataSource)bundleContext.getService(ref);
                 return ds;
             }
         }

Am 31.05.2012 19:13, schrieb Craig S. Dickson:
> Thanks Justin.
>
> Right now the ORM piece is pretty easy and I am just using stating SQL statements etc. If things get more complicated I will keep the JPA stuff from Aries in mind.
>
> BTW, do you happen to know if Aries and CQ play nicely together?
>
>
>
>
> On May 31, 2012, at 5:00 AM, Justin Edelson wrote:
>
>> Hi Craig,
>> Actually I was referring to the JPA Service (as your original email
>> mentioned Hibernate) and the JDBC Service specifications. I thought Aries
>> implemented both, but it appears to only implement the former.
>>
>> Regards,
>> Justin
>>
>> On Thu, May 31, 2012 at 4:01 AM, Craig S. Dickson
>> <cr...@craigsdickson.com>wrote:
>>
>>> HI Justin,
>>>
>>> Thanks for the link to Aries.
>>>
>>> My initial thought though is that Aries feels a little like a sledgehammer
>>> and my problem is just  a walnut. I do see how Aries could be used to
>>> provide a JNDI context in an OSGI world, but I am not necessarily tied to
>>> using JNDI, I just mentioned it as part of a common pattern demonstrated by
>>> "traditional" web apps.
>>>
>>> Is JNDI (via Aries etc) still the way to go in a Sling application, or is
>>> there a more "sling" way to achieve the same idea (ie. define a shared
>>> resource that can be obtained at runtime)? To me, this smells a little like
>>> the OSGI service model, where you might look for a service providing the
>>> JDBC DataSource interface and that also had some name property defined on
>>> it with the value you are looking for, but I am not sure if I am going down
>>> the wrong path.
>>>
>>> Thanks
>>>
>>>
>>>
>>>
>>> On May 30, 2012, at 3:31 PM, Justin Edelson wrote:
>>>
>>>> Hi Craig,
>>>> Have you looked at the OSGi enterprise specs and Apache Aries? That'd be
>>> a good place to start.
>>>> Justin
>>>>
>>>> On May 30, 2012, at 6:25 PM, "Craig S. Dickson"<cr...@craigsdickson.com>
>>> wrote:
>>>>> Hi,
>>>>>
>>>>> As part of a pure Sling application (ie. not CQ etc) I need to connect
>>> to a JDBC DB from my code (could be straight JDBC, might include Hibernate
>>> etc). The database contains business data, not content.
>>>>> In a "traditional" web app, I would probably use JNDI to look up a JDBC
>>> DataSource object under a pre-defined name. This way specific connection
>>> details, including security credentials are abstracted out of my code.
>>>>> Is there a Sling equivalent to this, or any best practices that anyone
>>> can recommend?
>>>>> I googled around a little, but most of the Sling + JDBC hits are to do
>>> with persistence managers for the JCR repo which is not my use case.
>>>>> Thanks in advance,
>>>>>
>>>>> Craig
>>>>>
>>>>>
>>>>> ==========================
>>>>> Craig S. Dickson
>>>>> Independent Consultant
>>>>> http://craigsdickson.com
>>>>> http://www.linkedin.com/in/craigsdickson
>>>>>
>>>>>
>>>>>
>>>>>
>>>


Re: Connecting to a JDBC DB from Sling

Posted by "Craig S. Dickson" <cr...@craigsdickson.com>.
Thanks Justin.

Right now the ORM piece is pretty easy and I am just using stating SQL statements etc. If things get more complicated I will keep the JPA stuff from Aries in mind.

BTW, do you happen to know if Aries and CQ play nicely together?




On May 31, 2012, at 5:00 AM, Justin Edelson wrote:

> Hi Craig,
> Actually I was referring to the JPA Service (as your original email
> mentioned Hibernate) and the JDBC Service specifications. I thought Aries
> implemented both, but it appears to only implement the former.
> 
> Regards,
> Justin
> 
> On Thu, May 31, 2012 at 4:01 AM, Craig S. Dickson
> <cr...@craigsdickson.com>wrote:
> 
>> HI Justin,
>> 
>> Thanks for the link to Aries.
>> 
>> My initial thought though is that Aries feels a little like a sledgehammer
>> and my problem is just  a walnut. I do see how Aries could be used to
>> provide a JNDI context in an OSGI world, but I am not necessarily tied to
>> using JNDI, I just mentioned it as part of a common pattern demonstrated by
>> "traditional" web apps.
>> 
>> Is JNDI (via Aries etc) still the way to go in a Sling application, or is
>> there a more "sling" way to achieve the same idea (ie. define a shared
>> resource that can be obtained at runtime)? To me, this smells a little like
>> the OSGI service model, where you might look for a service providing the
>> JDBC DataSource interface and that also had some name property defined on
>> it with the value you are looking for, but I am not sure if I am going down
>> the wrong path.
>> 
>> Thanks
>> 
>> 
>> 
>> 
>> On May 30, 2012, at 3:31 PM, Justin Edelson wrote:
>> 
>>> Hi Craig,
>>> Have you looked at the OSGi enterprise specs and Apache Aries? That'd be
>> a good place to start.
>>> 
>>> Justin
>>> 
>>> On May 30, 2012, at 6:25 PM, "Craig S. Dickson" <cr...@craigsdickson.com>
>> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> As part of a pure Sling application (ie. not CQ etc) I need to connect
>> to a JDBC DB from my code (could be straight JDBC, might include Hibernate
>> etc). The database contains business data, not content.
>>>> 
>>>> In a "traditional" web app, I would probably use JNDI to look up a JDBC
>> DataSource object under a pre-defined name. This way specific connection
>> details, including security credentials are abstracted out of my code.
>>>> 
>>>> Is there a Sling equivalent to this, or any best practices that anyone
>> can recommend?
>>>> 
>>>> I googled around a little, but most of the Sling + JDBC hits are to do
>> with persistence managers for the JCR repo which is not my use case.
>>>> 
>>>> Thanks in advance,
>>>> 
>>>> Craig
>>>> 
>>>> 
>>>> ==========================
>>>> Craig S. Dickson
>>>> Independent Consultant
>>>> http://craigsdickson.com
>>>> http://www.linkedin.com/in/craigsdickson
>>>> 
>>>> 
>>>> 
>>>> 
>> 
>> 


Re: Connecting to a JDBC DB from Sling

Posted by Justin Edelson <ju...@justinedelson.com>.
Hi Craig,
Actually I was referring to the JPA Service (as your original email
mentioned Hibernate) and the JDBC Service specifications. I thought Aries
implemented both, but it appears to only implement the former.

Regards,
Justin

On Thu, May 31, 2012 at 4:01 AM, Craig S. Dickson
<cr...@craigsdickson.com>wrote:

> HI Justin,
>
> Thanks for the link to Aries.
>
> My initial thought though is that Aries feels a little like a sledgehammer
> and my problem is just  a walnut. I do see how Aries could be used to
> provide a JNDI context in an OSGI world, but I am not necessarily tied to
> using JNDI, I just mentioned it as part of a common pattern demonstrated by
> "traditional" web apps.
>
> Is JNDI (via Aries etc) still the way to go in a Sling application, or is
> there a more "sling" way to achieve the same idea (ie. define a shared
> resource that can be obtained at runtime)? To me, this smells a little like
> the OSGI service model, where you might look for a service providing the
> JDBC DataSource interface and that also had some name property defined on
> it with the value you are looking for, but I am not sure if I am going down
> the wrong path.
>
> Thanks
>
>
>
>
> On May 30, 2012, at 3:31 PM, Justin Edelson wrote:
>
> > Hi Craig,
> > Have you looked at the OSGi enterprise specs and Apache Aries? That'd be
> a good place to start.
> >
> > Justin
> >
> > On May 30, 2012, at 6:25 PM, "Craig S. Dickson" <cr...@craigsdickson.com>
> wrote:
> >
> >> Hi,
> >>
> >> As part of a pure Sling application (ie. not CQ etc) I need to connect
> to a JDBC DB from my code (could be straight JDBC, might include Hibernate
> etc). The database contains business data, not content.
> >>
> >> In a "traditional" web app, I would probably use JNDI to look up a JDBC
> DataSource object under a pre-defined name. This way specific connection
> details, including security credentials are abstracted out of my code.
> >>
> >> Is there a Sling equivalent to this, or any best practices that anyone
> can recommend?
> >>
> >> I googled around a little, but most of the Sling + JDBC hits are to do
> with persistence managers for the JCR repo which is not my use case.
> >>
> >> Thanks in advance,
> >>
> >> Craig
> >>
> >>
> >> ==========================
> >> Craig S. Dickson
> >> Independent Consultant
> >> http://craigsdickson.com
> >> http://www.linkedin.com/in/craigsdickson
> >>
> >>
> >>
> >>
>
>

Re: Connecting to a JDBC DB from Sling

Posted by "Craig S. Dickson" <cr...@craigsdickson.com>.
HI Justin,

Thanks for the link to Aries.

My initial thought though is that Aries feels a little like a sledgehammer and my problem is just  a walnut. I do see how Aries could be used to provide a JNDI context in an OSGI world, but I am not necessarily tied to using JNDI, I just mentioned it as part of a common pattern demonstrated by "traditional" web apps.

Is JNDI (via Aries etc) still the way to go in a Sling application, or is there a more "sling" way to achieve the same idea (ie. define a shared resource that can be obtained at runtime)? To me, this smells a little like the OSGI service model, where you might look for a service providing the JDBC DataSource interface and that also had some name property defined on it with the value you are looking for, but I am not sure if I am going down the wrong path.

Thanks
 



On May 30, 2012, at 3:31 PM, Justin Edelson wrote:

> Hi Craig,
> Have you looked at the OSGi enterprise specs and Apache Aries? That'd be a good place to start.
> 
> Justin
> 
> On May 30, 2012, at 6:25 PM, "Craig S. Dickson" <cr...@craigsdickson.com> wrote:
> 
>> Hi,
>> 
>> As part of a pure Sling application (ie. not CQ etc) I need to connect to a JDBC DB from my code (could be straight JDBC, might include Hibernate etc). The database contains business data, not content.
>> 
>> In a "traditional" web app, I would probably use JNDI to look up a JDBC DataSource object under a pre-defined name. This way specific connection details, including security credentials are abstracted out of my code.
>> 
>> Is there a Sling equivalent to this, or any best practices that anyone can recommend?
>> 
>> I googled around a little, but most of the Sling + JDBC hits are to do with persistence managers for the JCR repo which is not my use case.
>> 
>> Thanks in advance,
>> 
>> Craig
>> 
>> 
>> ==========================
>> Craig S. Dickson
>> Independent Consultant
>> http://craigsdickson.com
>> http://www.linkedin.com/in/craigsdickson
>> 
>> 
>> 
>> 


Re: Connecting to a JDBC DB from Sling

Posted by Justin Edelson <ju...@gmail.com>.
Hi Craig,
Have you looked at the OSGi enterprise specs and Apache Aries? That'd be a good place to start.

Justin

On May 30, 2012, at 6:25 PM, "Craig S. Dickson" <cr...@craigsdickson.com> wrote:

> Hi,
> 
> As part of a pure Sling application (ie. not CQ etc) I need to connect to a JDBC DB from my code (could be straight JDBC, might include Hibernate etc). The database contains business data, not content.
> 
> In a "traditional" web app, I would probably use JNDI to look up a JDBC DataSource object under a pre-defined name. This way specific connection details, including security credentials are abstracted out of my code.
> 
> Is there a Sling equivalent to this, or any best practices that anyone can recommend?
> 
> I googled around a little, but most of the Sling + JDBC hits are to do with persistence managers for the JCR repo which is not my use case.
> 
> Thanks in advance,
> 
> Craig
> 
> 
> ==========================
> Craig S. Dickson
> Independent Consultant
> http://craigsdickson.com
> http://www.linkedin.com/in/craigsdickson
> 
> 
> 
>