自写自看

数据库master/slave模式

mysql的master/slave模式:
采用ReplicationConnection链接后,设置Connection.setReadOnly(true)时,读写可以从master,slave中任意读写。
设置Connection.setReadOnly(false)只能从master中读取。
采用此方法可以做到只在master上更新数据,利用slave来读取数据。
详细介绍
http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-replication-connection.html


posted on 2007-12-12 20:40 昨夜人生 阅读(927) 评论(0)  编辑  收藏 所属分类: 其他Java