Package com.mysql.jdbc

Examples of com.mysql.jdbc.ReplicationConnection.createStatement()


    UnreliableSocketFactory.downHost("slave1");
    UnreliableSocketFactory.downHost("slave2");
   
    assertTrue(conn2.isMasterConnection());
    // should succeed, as we're still on master:
    conn2.createStatement().execute("/* ping */ SELECT 1");   
   
    UnreliableSocketFactory.dontDownHost("slave1");
    UnreliableSocketFactory.dontDownHost("slave2");
    UnreliableSocketFactory.downHost("master");
   
View Full Code Here


    UnreliableSocketFactory.dontDownHost("slave1");
    UnreliableSocketFactory.dontDownHost("slave2");
    UnreliableSocketFactory.downHost("master");
   
    try {
      conn2.createStatement().execute("/* ping */ SELECT 1")
      fail("should have failed because master is offline");
    } catch (SQLException e) {
     
    }
   
View Full Code Here

    } catch (SQLException e) {
     
    }
   
    UnreliableSocketFactory.dontDownHost("master");
    conn2.createStatement().execute("SELECT 1")
    // continue on slave2:
    conn2.setReadOnly(true);
   
    // should succeed, as slave2 is up:
    conn2.createStatement().execute("/* ping */ SELECT 1")
View Full Code Here

    conn2.createStatement().execute("SELECT 1")
    // continue on slave2:
    conn2.setReadOnly(true);
   
    // should succeed, as slave2 is up:
    conn2.createStatement().execute("/* ping */ SELECT 1")
   
    UnreliableSocketFactory.downHost("slave2");
   
    try {
      conn2.createStatement().execute("/* ping */ SELECT 1")
View Full Code Here

    conn2.createStatement().execute("/* ping */ SELECT 1")
   
    UnreliableSocketFactory.downHost("slave2");
   
    try {
      conn2.createStatement().execute("/* ping */ SELECT 1")
      fail("should have failed because slave2 is offline and the active chosen connection.");
    } catch (SQLException e) {}
     
   
    conn2.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.