blob: ee21633e94664f32ce276ab49b2880671ab91ead [file] [log] [blame]
<!--
▄▄▄ ██▓███ ▄▄▄ ▄████▄ ██░ ██ ▓█████ ██▓ ▄████ ███▄ █ ██▓▄▄▄█████▓▓█████
▒████▄ ▓██░ ██▒▒████▄ ▒██▀ ▀█ ▓██░ ██▒▓█ ▀ ▓██▒ ██▒ ▀█▒ ██ ▀█ █ ▓██▒▓ ██▒ ▓▒▓█ ▀
▒██ ▀█▄ ▓██░ ██▓▒▒██ ▀█▄ ▒▓█ ▄ ▒██▀▀██░▒███ ▒██▒▒██░▄▄▄░▓██ ▀█ ██▒▒██▒▒ ▓██░ ▒░▒███
░██▄▄▄▄██ ▒██▄█▓▒ ▒░██▄▄▄▄██ ▒▓▓▄ ▄██▒░▓█ ░██ ▒▓█ ▄ ░██░░▓█ ██▓▓██▒ ▐▌██▒░██░░ ▓██▓ ░ ▒▓█ ▄
▓█ ▓██▒▒██▒ ░ ░ ▓█ ▓██▒▒ ▓███▀ ░░▓█▒░██▓░▒████▒ ░██░░▒▓███▀▒▒██░ ▓██░░██░ ▒██▒ ░ ░▒████▒
▒▒ ▓▒█░▒▓▒░ ░ ░ ▒▒ ▓▒█░░ ░▒ ▒ ░ ▒ ░░▒░▒░░ ▒░ ░ ░▓ ░▒ ▒ ░ ▒░ ▒ ▒ ░▓ ▒ ░░ ░░ ▒░ ░
▒ ▒▒ ░░▒ ░ ▒ ▒▒ ░ ░ ▒ ▒ ░▒░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░░ ░ ▒░ ▒ ░ ░ ░ ░ ░
░ ▒ ░░ ░ ▒ ░ ░ ░░ ░ ░ ▒ ░░ ░ ░ ░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
-->
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="canonical" href="https://ignite.apache.org/features/rdbmsintegration.html" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>Automatic RDBMS Integration - Apache Ignite</title>
<!--#include virtual="/includes/styles.html" -->
<!--#include virtual="/includes/sh.html" -->
</head>
<body>
<!--#include virtual="/includes/header.html" -->
<article>
<header>
<div class="container">
<h1>Automatically Integrate <strong>with RDBMSs</strong></h1>
</div>
</header>
<div class="container">
<p>
Apache Ignite® provides support for integrating with a variety of persistence stores.
It allows you to connect to the database, import schemas, configure indexed types, and automatically generate all the
required XML OR-mapping configuration and Java domain model POJOs that you can easily download and copy into your project.
</p>
<a href="/images/domain-model.png"><img class="img-responsive diagram-right" src="/images/domain-model.png" alt="Automatically Integrate with RDBMSs" /></a>
<p>Ignite can integrate with any relational database (RDBMS) that supports a JDBC driver - Oracle, PostgreSQL, Microsoft SQL Server, and MySQL.</p>
<h2>RDBMS Integration Wizard</h2>
<p>Ignite supports automatic RDBMS integration via <a href="https://console.gridgain.com" target="_blank" rel="noopener">Ignite Web Console</a>
which is an interactive configuration wizard, management and monitoring tool that allows you to:</p>
<ul class="page-list">
<li>Create and download various configurations for your Ignite cluster.</li>
<li>Automatically construct Ignite's SQL metadata from any RDBMS schemas.</li>
<li>Execute SQL queries over your in-memory caches.</li>
<li>View query execution plans, in-memory schemas and streaming charts.</li>
</ul>
<p>Ignite Web Console is an innovative tool that offers plenty of rich functionalities to manage the Ignite cluster and is not limited to features mentioned above.</p>
<h3>Example</h3>
<p>Here is an example of automatically generated Person class, as well as Java and XML configurations, imported from a MySQL PERSON table via Ignite Web Console.</p>
<!-- Nav tabs -->
<ul id="web-console-example" class="nav nav-tabs">
<li ><a class="active" href="#example-person" aria-controls="home" data-toggle="tab">Person</a></li>
<li><a href="#example-xml" aria-controls="profile" data-toggle="tab">XML</a></li>
<li><a href="#example-java" aria-controls="profile" data-toggle="tab">Java</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane" id="example-xml">
<pre class="brush:xml">
&lt;bean class="org.apache.ignite.configuration.IgniteConfiguration"&gt;
...
&lt;property name="cacheStoreFactory"&gt;
&lt;bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory"&gt;
&lt;property name="dataSourceBean" value="dsMySQL"/&gt;
&lt;property name="dialect"&gt;
&lt;bean class="org.apache.ignite.cache.store.jdbc.dialect.MySQLDialect"/&gt;
&lt;/property&gt;
&lt;property name="types"&gt;
&lt;list&gt;
&lt;bean class="org.apache.ignite.cache.store.jdbc.JdbcType"&gt;
&lt;property name="cacheName" value="PersonCache"/&gt;
&lt;property name="keyType" value="java.lang.Integer"/&gt;
&lt;property name="valueType" value="com.apache.ignite.myexample.model.Person"/&gt;
&lt;property name="databaseSchema" value="test"/&gt;
&lt;property name="databaseTable" value="person"/&gt;
&lt;property name="keyFields"&gt;
&lt;list&gt;
...
&lt;/list&gt;
&lt;/property&gt;
&lt;property name="valueFields"&gt;
&lt;list&gt;
...
&lt;/list&gt;
&lt;/property&gt;
&lt;/bean&gt;
&lt;/list&gt;
&lt;/property&gt;
&lt;/bean&gt;
&lt;/property&gt;
...
&lt;/bean&gt;
</pre>
</div>
<div class="tab-pane" id="example-java">
<pre class="brush:java">
/**
* This configuration was generated by GridGain Web Console (10/26/2016 11:12)
*/
public class ClientConfigurationFactory {
private static final Properties props = new Properties();
static {
try (InputStream in = IgniteConfiguration.class.getClassLoader().getResourceAsStream("secret.properties")) {
props.load(in);
}
catch (Exception ignored) {
// No-op.
}
}
/** Helper class for datasource creation. */
public static class DataSources {
public static final MysqlDataSource INSTANCE_dsMySQL = createdsMySQL();
private static MysqlDataSource createdsMySQL() {
MysqlDataSource dataSource = new MysqlDataSource();
dataSource.setURL(props.getProperty("dsMySQL.jdbc.url"));
dataSource.setUser(props.getProperty("dsMySQL.jdbc.username"));
dataSource.setPassword(props.getProperty("dsMySQL.jdbc.password"));
return dataSource;
}
}
...
}
</pre>
</div>
<div class="tab-pane active" id="example-person">
<pre class="brush:java">
/**
* Person definition.
*
* This POJO was generated by GridGain Web Console (10/26/2016 11:12)
*/
public class Person implements Serializable {
/** */
private static final long serialVersionUID = 0L;
/** Value for id. */
private int id;
/** Value for orgid. */
private Integer orgid;
/** Value for name. */
private String name;
/** Value for salary. */
private Integer salary;
...
}
</pre>
</div>
</div>
<h2>Hosted Management</h2>
<p>Visit our <a href="/addons.html" target="_blank" rel="noopener">Manage</a> page to learn more about the projects that intend to make user experience with Ignite easier.</p>
<p>
<a href="https://apacheignite-tools.readme.io/docs" target="_blank" rel="noopener">
<b>Get started with Ignite Web Console <i class="fa fa-angle-double-right"></i></b>
</a>
</p>
</div>
</article>
<!--#include virtual="/includes/footer.html" -->
<!--#include virtual="/includes/scripts.html" -->
</body>
</html>