Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Cache driver as Datasource #24

Open
datsabk opened this issue May 9, 2018 · 1 comment
Open

Using Cache driver as Datasource #24

datsabk opened this issue May 9, 2018 · 1 comment

Comments

@datsabk
Copy link

datsabk commented May 9, 2018

Hello,

Is it possible to configure this cache driver as a JNDI datasource? If yes, how do I do that with IBM Liberty server?

@emmanuel-keller
Copy link
Contributor

emmanuel-keller commented Jul 9, 2018

jdbc-cache driver is basically a JDBC Driver.

If I refer to this documentation:
https://www.ibm.com/support/knowledgecenter/en/SSAW57_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/twlp_dep_configuring_ds.html

While copying the jdbc-cache-driver.jar file in C:/DB2/java, it would be possible to do something like that:

<library id="JdbcCacheLib">
    <fileset dir="C:/DB2/java" includes="jdbc-cache-driver.jar"/>
</library>

Then you may use the following template as a datasource definition:

<dataSource id="DefaultDataSource" jndiName="jdbc/jdbcCache">
  <jdbcDriver libraryRef="JdbcCacheLib"/>
  <properties.cache URL="jdbc:cache:mem:my-mem-cache" url="jdbc:oracle:oci:@//localhost:1521/SAMPLEDB"/>                     
</dataSource>

Next, the point is to be able to pass the following properties:

  • cache.driver.url = {the JDBC connection URL to your database}
  • cache.driver.class={the class name of the JDBC Driver of your database}

Disclaimer: This is a not tested configuration. It is just here as an example.

Let us know if you can make it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants