It sounds like you have done the right things, but my guess is that you don’t 
have a JDBC service implementation for SQLServer. H2 and Postgres have done the 
work to implement the OSGi standard (it’s pretty small), but quite a few other 
providers haven’t. 

You could either roll your own adapter in 100 lines of code, or grab one from 
Open Source, for example 
https://github.com/ops4j/org.ops4j.pax.jdbc/blob/master/pax-jdbc-mssql/pom.xml

This will register the DataSourceFactory service needed by Aries, and 
everything should work from there.

Best Regards,

Tim

Sent from my iPhone

> On 8 Dec 2018, at 18:05, Jim Rayburn via osgi-dev <[email protected]> 
> wrote:
> 
> My environment is Eclipse and BND using Bndtools. I have an application, 
> providerapi, provider, persistenceapi and persistenceprovider bundles. I have 
> a configuration.json file in the application bundles 
> resource/OSGI-INF/configurator/ folder. I configured it to connect to a 
> postgres database. I provided eclipselink parameters in the persistence.xml 
> file to drop and create the database schema and tables. It all works using 
> the postgres database.
>  
> When I configure it to connect to a MS Sql Server (2012). I am using the 
> com.microsoft.sqlserver:mssql-jdbc:jar:7.1.3.jre8-preview bundle.
>  
> …
>                 "osgi.jdbc.driver.class": 
> "com.microsoft.sqlserver.jdbc.SqlServerDriver",
>                 "url": "jdbc:sqlserver://127.0.0.1:1433/db",
> …
>  
> I verified that I am using a sys_admin user so permissions should not be 
> causing an issue.
>  
> For postgres I see it using the zaxxer bundle (HikariPool) but I don’t get 
> the same output or even errors (that differ from accessing postgres) when 
> trying to connect to the SqlServer.
>  
> Thank you for any help you may be able to provide.
>  
> Jim
>  
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to