本文整理汇总了Java中com.mysql.jdbc.ReplicationConnection.getCurrentConnection方法的典型用法代码示例。如果您正苦于以下问题:Java ReplicationConnection.getCurrentConnection方法的具体用法?Java ReplicationConnection.getCurrentConnection怎么用?Java ReplicationConnection.getCurrentConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mysql.jdbc.ReplicationConnection
的用法示例。
在下文中一共展示了ReplicationConnection.getCurrentConnection方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getActiveMySQLConnectionChecked
import com.mysql.jdbc.ReplicationConnection; //导入方法依赖的package包/类
/**
* Get the active connection as an object implementing the
* internal MySQLConnection interface. This should not be used
* unless a MySQLConnection is required.
*
* {@link getActiveConnection()} is provided for the general case.
* The returned object is not a {@link ReplicationConnection}, but
* instead the {@link LoadBalancedConnectionProxy} for either the
* master or slaves.
*/
protected MySQLConnection getActiveMySQLConnectionChecked() throws SQLException {
ReplicationConnection c = (ReplicationConnection) getActiveConnection();
MySQLConnection mc = (MySQLConnection) c.getCurrentConnection();
return mc;
}
示例2: getActiveMySQLConnection
import com.mysql.jdbc.ReplicationConnection; //导入方法依赖的package包/类
/**
* Get the active connection as an object implementing the
* internal MySQLConnection interface. This should not be used
* unless a MySQLConnection is required.
*
* {@link getActiveConnection()} is provided for the general case.
* The returned object is not a {@link ReplicationConnection}, but
* instead the {@link LoadBalancedConnectionProxy} for either the
* master or slaves.
*/
protected MySQLConnection getActiveMySQLConnection() throws SQLException {
ReplicationConnection c = (ReplicationConnection) getActiveConnection();
MySQLConnection mc = (MySQLConnection) c.getCurrentConnection();
return mc;
}
示例3: getActiveMySQLConnection
import com.mysql.jdbc.ReplicationConnection; //导入方法依赖的package包/类
/**
* Get the active connection as an object implementing the
* internal MySQLConnection interface. This should not be used
* unless a MySQLConnection is required.
*
* {@link getActiveConnection()} is provided for the general case.
* The returned object is not a {@link ReplicationConnection}, but
* instead the {@link LoadBalancingConnectionProxy} for either the
* master or slaves.
*/
protected MySQLConnection getActiveMySQLConnection() throws SQLException {
ReplicationConnection c = (ReplicationConnection) getActiveConnection();
MySQLConnection mc = (MySQLConnection) c.getCurrentConnection();
return mc;
}
示例4: getActiveMySQLConnection
import com.mysql.jdbc.ReplicationConnection; //导入方法依赖的package包/类
/**
* Get the active connection as an object implementing the
* internal MySQLConnection interface. This should not be used
* unless a MySQLConnection is required.
*
* {@link getActiveConnection()} is provided for the general case.
* The returned object is not a {@link ReplicationConnection}, but
* instead the {@link LoadBalancingConnectionProxy} for either the
* master or slaves.
*/
protected MySQLConnection getActiveMySQLConnection() throws SQLException {
ReplicationConnection c = (ReplicationConnection) getActiveConnection();
MySQLConnection mc = (MySQLConnection) c.getCurrentConnection();
return mc;
}