blob: 540e3b5419573eb404936df9651020d0df46e3f1 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Java API on ShardingSphere</title>
<link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/java-api/</link>
<description>Recent content in Java API on ShardingSphere</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<atom:link href="https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/java-api/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Mode</title>
<link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/java-api/mode/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/java-api/mode/</guid>
<description>Background Build the running mode through Java API.
Parameters Class name: org.apache.shardingsphere.infra.config.mode.ModeConfiguration
Attributes:
Name DataType Description Default Value type String Type of mode configuration
Values could be: Standalone or Cluster Standalone repository PersistRepositoryConfiguration Persist repository configuration
Standalone type uses StandalonePersistRepositoryConfiguration
Cluster type uses ClusterPersistRepositoryConfiguration overwrite boolean Whether overwrite persistent configuration with local configuration false Standalone Persist Configuration Class name: org.</description>
</item>
<item>
<title>Data Source</title>
<link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/java-api/data-source/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/java-api/data-source/</guid>
<description>Background ShardingSphere-JDBC supports all database JDBC drivers and connection pools.
This section describes how to configure data sources through the JAVA API.
Procedure 1. Import Maven dependency. &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;org.apache.shardingsphere&amp;lt;/groupId&amp;gt; &amp;lt;artifactId&amp;gt;shardingsphere-jdbc-core&amp;lt;/artifactId&amp;gt; &amp;lt;version&amp;gt;${latest.release.version}&amp;lt;/version&amp;gt; &amp;lt;/dependency&amp;gt; Notice: Please change ${latest.release.version} to the actual version.
Sample ModeConfiguration modeConfig = // Build running mode Map&amp;lt;String, DataSource&amp;gt; dataSourceMap = createDataSources(); Collection&amp;lt;RuleConfiguration&amp;gt; ruleConfigs = ... // Build specific rules Properties props = ... // Build attribute configuration DataSource dataSource = ShardingSphereDataSourceFactory.</description>
</item>
<item>
<title>Algorithm</title>
<link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/java-api/algorithm/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/java-api/algorithm/</guid>
<description>Sharding ShardingRuleConfiguration ruleConfiguration = new ShardingRuleConfiguration(); // algorithmName is specified by users and should be consistent with the sharding algorithm in the sharding strategy. // type and props, please refer to the built-in sharding algorithm: https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/builtin-algorithm/sharding/ ruleConfiguration.getShardingAlgorithms().put(&amp;#34;algorithmName&amp;#34;, new AlgorithmConfiguration(&amp;#34;xxx&amp;#34;, new Properties())); Encryption // encryptorName is specified by users, and its property should be consistent with that of encryptorName in encryption rules. // type and props, please refer to the built-in encryption algorithm: https://shardingsphere.</description>
</item>
</channel>
</rss>