您將需要使用JDBC URL與司機
com.mysql.jdbc.ReplicationDriver
這是拾起URL像
jdbc:mysql:replication//master_ip:3306,slave_1_ip:3306
RDS將JDBC_CONNECTION_STRING
系統的變量。從JBOSS
<datasource jndi-name="java:jboss/datasources/MysqlDS"
enabled="true" use-java-context="true" pool-name="MysqlDS" use-ccm="true">
<connection-url>jdbc:mysql://${env.AMAZON_RDS_MYSQL_DB_HOST}:${env.AMAZON_RDS_MYSQL_DB_PORT}/${env.AMAZON_RDS_MYSQL_DB_NAME}?autoReconnect=true&verifyServerCertificate=false&useSSL=true&requireSSL=true
</connection-url>
<driver>mysql</driver>
<security>
<user-name>${env.AMAZON_RDS_MYSQL_DB_USERNAME}</user-name>
<password>${env.AMAZON_RDS_MYSQL_DB_PASSWORD}</password>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<background-validation>true</background-validation>
</validation>
<pool>
<flush-strategy>IdleConnections</flush-strategy>
<allow-multiple-users />
</pool>
</datasource>
----其他更新------- 樣品datasource.xml