You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by abdulshameer <s....@tcs.com> on 2013/09/03 12:11:59 UTC

Establishing a JDBC connectivity to database in servicemix

Hi,

   We have trying to establish a jdbc  connectivity to db in servicemix for
our web application.If anyone knows please help me regarding this with
sample code



--
View this message in context: http://servicemix.396122.n5.nabble.com/Establishing-a-JDBC-connectivity-to-database-in-servicemix-tp5717731.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Re: Establishing a JDBC connectivity to database in servicemix

Posted by Cristiano Costantini <cr...@gmail.com>.
Hi,
I have no direct experience with Hibernate in Servicemix, but I've recently
faced many issues while trying to use JPA with Eclipselink and it was not
easy at all to get it working!

I came to the conclusion to use "spring-orm" within servicemix, it seems to
me the more stable way to use JPA.
This requires to use spring-orm to build an EntitiyManagerFactory and
inject into my application.

For this I faced two main issues:
- I didn't achieved to have Eclipselink work with dynamic weaving, so I
needed to disable it.
- Spring-Jdbc does not import by default MySQL JDBC driver, so I needed to:
   - use a OSGi fragment to extend Spring-JDBC
   - or use Apache Common DBCP

I did shared some sample code of my experiments on github:
https://github.com/cristcost/spring-orm-eclipselink-sample
Spring-orm could be used also with Hibernate, but I have only tested with
Eclipselink
Also my sample code is not a web application, but I hope it could help.

Cristiano





2013/9/4 abdulshameer <s....@tcs.com>

> We are trying to integrate Hibernate in servicemix. We had a sample JSF
> page
> where we use this hibernate. It is working fine in tomcat. But when we dont
> know how to configure hibernate in servicemix?any idea
>
>
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/Establishing-a-JDBC-connectivity-to-database-in-servicemix-tp5717731p5717738.html
> Sent from the ServiceMix - Dev mailing list archive at Nabble.com.
>

Re: Establishing a JDBC connectivity to database in servicemix

Posted by abdulshameer <s....@tcs.com>.
We are trying to integrate Hibernate in servicemix. We had a sample JSF page
where we use this hibernate. It is working fine in tomcat. But when we dont
know how to configure hibernate in servicemix?any idea



--
View this message in context: http://servicemix.396122.n5.nabble.com/Establishing-a-JDBC-connectivity-to-database-in-servicemix-tp5717731p5717738.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Re: Establishing a JDBC connectivity to database in servicemix

Posted by Cristiano Costantini <cr...@gmail.com>.
Hi,
Which issues are you encountering?

Cristiano

Il giorno martedì 3 settembre 2013, abdulshameer ha scritto:

> Hi,
>
>    We have trying to establish a jdbc  connectivity to db in servicemix for
> our web application.If anyone knows please help me regarding this with
> sample code
>
>
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/Establishing-a-JDBC-connectivity-to-database-in-servicemix-tp5717731.html
> Sent from the ServiceMix - Dev mailing list archive at Nabble.com.
>

Re: Establishing a JDBC connectivity to database in servicemix

Posted by jacobdotcosta <ja...@gmail.com>.
Hi,

I have tried to use OpenJPA with Servicemix but have not succeded so I have
just deployed a JDBC connection pool using spring:


The values between @@ are Gradle resource filter variables.

I'm then referencing the JDBC pool with blueprint bean references:


I'm using PostgreSQL database. To achieve this I had to wrap the PGSQL
driver to servicemix. Because this was mixed with my OpenJPA tests I'm not
sure if this is a requirement but I think you have to install the
commons-dbcp bundle and enable dynamic import on it:


I hope this helps.



-----

Best
regards, Cumprimentos, Un saludo, Ant&oacute;nio
Jacob Costa 

http://www.trikorasolutions.com/ 

http://linkd.in/ajcin 
--
View this message in context: http://servicemix.396122.n5.nabble.com/Establishing-a-JDBC-connectivity-to-database-in-servicemix-tp5717731p5717772.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.