Connect Workday to your favorite reporting tools without moving data.
Learn More →Access Live Epicor Kinetic Data in Spring Boot
Connect to Epicor Kinetic in a Spring Boot Application using CData JDBC Epicor Kinetic Driver
Spring Boot is a framework that makes engineering Java web applications easier. It offers the ability to create standalone applications with minimal configuration. When paired with the CData JDBC driver for Epicor Kinetic, Spring Boot can work with live Epicor Kinetic data. This article shows how to configure data sources and retrieve data in your Java Spring Boot Application, using the CData JDBC Driver for Epicor Kinetic.
With built-in optimized data processing, the CData JDBC Driver offers unmatched performance for interacting with live Epicor Kinetic data. When you issue complex SQL queries to Epicor Kinetic, the driver pushes supported SQL operations, like filters and aggregations, directly to Epicor Kinetic and utilizes the embedded SQL engine to process unsupported operations client-side (often SQL functions and JOIN operations). Its built-in dynamic metadata querying allows you to work with and analyze Epicor Kinetic data using native data types.
Creating the Spring Boot Project in Java
In an IDE (in this tutorial, we use IntelliJ), choose a Maven project:
In the generated project, go to the pom.xml file, and add the required dependencies for Spring Boot:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.2</version>
<relativePath/>
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>id.install-file</id>
<phase>clean</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>C:\Program Files\CData\CData JDBC Driver for Epicor Kinetic ####\lib\cdata.jdbc.epicorkinetic.jar</file>
<groupId>org.cdata.connectors</groupId>
<artifactId>cdata-epicorkinetic-connector</artifactId>
<version>21</version>
<packaging>jar</packaging>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.cdata.connectors</groupId>
<artifactId>cdata-epicorkinetic-connector</artifactId>
<version>21</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>test</id>
<name>My Repository</name>
<url>scp://repo/maven2</url>
<layout>default</layout>
</repository>
</distributionManagement>
</project>
Project Structure
In the java directory, create a new package. Usually the name of the package is the name of the groupId (com.example) followed by the artifactId (.MDS).
Make sure that the "java" directory is the sources root; this is indicated with a blue color. You may need to right click the java directory and select Mark Directory -> Sources Root. Also, the resources directory should be marked as Resources Root.

Database Connection Properties
In the application.properties file, we set the configuration properties for the Epicor Kinetic JDBC Driver, using the Class name and JDBC URL:
spring.datasource.driver=cdata.jdbc.epicorkinetic.epicorKineticDriver
spring.datasource.url=jdbc:epicorkinetic:Service=Erp.BO.CustomerSvc;ERPInstance=MyInstance;URL=https://myaccount.epicorsaas.com;User=username;Password=password;InitiateOAuth=GETANDREFRESH
Built-in Connection String Designer
For assistance in constructing the JDBC URL, use the connection string designer built into the Epicor Kinetic JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.epicorkinetic.jar
To successfully connect to your ERP instance, you must specify the following connection properties:
- Url:the URL of the server hosting your ERP instance. For example, https://myserver.EpicorSaaS.com
- ERPInstance: the name of your ERP instance.
- User: the username of your account.
- Password: the password of your account.
- Service: the service you want to retrieve data from. For example, BaqSvc.
In addition, you may also set the optional connection properties:
- ApiKey: An optional key that may be required for connection to some services depending on your account configuration.
- ApiVersion: Defaults to v1. May be set to v2 to use the newer Epicor API.
- Company: Required if you set the ApiVersion to v2.

After setting the properties in the application.properties file, we now configure them.
Data Source Configuration
First, we mark the Epicor Kinetic data source as our primary data source. Then, we create a Data Source Bean.
Create a DriverManagerDataSource.java file and create a Bean within it, as shown below. If @Bean gives an error, Spring Boot may not have loaded properly. To fix this, go to File -> Invalidate Caches and restart. Additionally, make sure that Maven has added the Spring Boot dependencies.
To create a data source bean, we use DriverManagerDataSource Class. This class allows us to set the properties of the data source. The following code shows the bean definition of our data source. Each driver should have a bean.
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.core.env.Environment;
import javax.sql.DataSource;
public class DriverManagerDataSource{
@Autowired
private static Environment env;
@Bean(name ="epicorKinetic")
@Primary
public static DataSource epicorKineticDataSource()
{
DataSourceBuilder<?> dataSourceBuilder = DataSourceBuilder.create();
dataSourceBuilder.driverClassName("cdata.jdbc.epicorkinetic.epicorKineticDriver");
dataSourceBuilder.url("jdbc:epicorkinetic:Service=Erp.BO.CustomerSvc;ERPInstance=MyInstance;URL=https://myaccount.epicorsaas.com;User=username;Password=password;InitiateOAuth=GETANDREFRESH");
return dataSourceBuilder.build();
}
//@Override
public void setEnvironment( final Environment environment) {
env=environment;
}
}
Next, move the Epicor Kinetic jar file to the Documents folder (see path in command below). Then, click the
Maven icon (top right corner of IntelliJ) and click "Execute Maven Goal." Now, run the following command:
mvn install:install-file -Dfile=C:\Program Files\CData\CData JDBC Driver for Epicor Kinetic ####\lib\cdata.jdbc.epicorkinetic.jar -DgroupId=cdata.jdbc.epicorkinetic -DartifactId=cdata-epicorkinetic-connector -Dversion=21 -Dpackaging=jar
After pressing enter, we see the following output:
Testing the Connection
The last step is testing the connection. We call the data source in the main method of MDSApplication.java:
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import java.sql.Connection;
import java.sql.SQLException;
import static com.example.demo.DriverManagerDataSources.epicorKineticDataSource;
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class MDSApplication {
//remove the comment on the line below
public static void main (){
SpringApplication.run(DemoApplication.class, args);
Connection conn = epicorKineticDataSource().getConnection();
System.out.println("Catalog: "+ conn.getCatalog());
}
}
The output generated should look like this:
Free Trial & More Information
Download a free, 30-day trial of the CData JDBC Driver for Epicor Kinetic and start working with your live Epicor Kinetic in Spring Boot