Oracle
This is an enterprise feature. |
<dependency>
<groupId>one.microstream</groupId>
<artifactId>microstream-enterprise-afs-sql</artifactId>
<version>05.00.02-MS-GA</version>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>19.7.0.0</version>
</dependency>
OracleDataSource dataSource = new OracleDataSource();
dataSource.setURL("jdbc:oracle:thin:@localhost:1521/db");
dataSource.setUser("user");
dataSource.setPassword("secret");
SqlFileSystem fileSystem = SqlFileSystem.New(
SqlConnector.Caching(
SqlProviderOracle.New(dataSource)
)
);
EmbeddedStorage.start(fileSystem.ensureDirectoryPath("microstream_storage"));
Configuration
When using external configuration Oracle can be set as follows. Please note that you have to define a data source provider.
microstream-storage.properties
storage-filesystem.sql.oracle.data-source-provider=com.sample.MyDataSourceProvider
storage-filesystem.sql.oracle.catalog=mycatalog
storage-filesystem.sql.oracle.schema=myschema
storage-filesystem.sql.oracle.url=jdbc:oracle:thin:@localhost:1521/db
storage-filesystem.sql.oracle.user=username
storage-filesystem.sql.oracle.password=secret
MyDataSourceProvider.java
package com.sample;
import one.microstream.afs.sql.types.SqlDataSourceProvider
public class MyDataSourceProvider implements SqlDataSourceProvider
{
public DataSource provideDataSource(Configuration configuration)
{
String url = configuration.get("url");
String user = configuration.get("user");
String password = configuration.get("password");
// TODO: return data source of your choice, e.g. from a connection pool
}
}