Package com.mysql.jdbc

Examples of com.mysql.jdbc.NonRegisteringDriver


        ForcedLoadBalanceStrategy.class.getName());
    props.setProperty("loadBalanceBlacklistTimeout", "5000");
    props.setProperty("loadBalancePingTimeout", "100");
    props.setProperty("loadBalanceValidateConnectionOnSwapServer", "true");

    String portNumber = new NonRegisteringDriver().parseURL(dbUrl, null)
        .getProperty(NonRegisteringDriver.PORT_PROPERTY_KEY);

    if (portNumber == null) {
      portNumber = "3306";
    }
View Full Code Here


    Properties props = new Properties();
    props.setProperty("loadBalanceStrategy",
        CountingReBalanceStrategy.class.getName());
    props.setProperty("loadBalanceAutoCommitStatementThreshold", "3");

    String portNumber = new NonRegisteringDriver().parseURL(dbUrl, null)
        .getProperty(NonRegisteringDriver.PORT_PROPERTY_KEY);

    if (portNumber == null) {
      portNumber = "3306";
    }
View Full Code Here

  public void testBug56429() throws Exception {
    Properties props = new Driver().parseURL(BaseTestCase.dbUrl, null);
    props.setProperty("autoReconnect", "true");
    props.setProperty("socketFactory", "testsuite.UnreliableSocketFactory");

    Properties urlProps = new NonRegisteringDriver().parseURL(
        BaseTestCase.dbUrl, null);

    String host = urlProps.getProperty(Driver.HOST_PROPERTY_KEY);
    String port = urlProps.getProperty(Driver.PORT_PROPERTY_KEY);
View Full Code Here

  public void testBug58706() throws Exception {
    Properties props = new Driver().parseURL(BaseTestCase.dbUrl, null);
    props.setProperty("autoReconnect", "true");
    props.setProperty("socketFactory", "testsuite.UnreliableSocketFactory");

    Properties urlProps = new NonRegisteringDriver().parseURL(dbUrl,
        null);

    String host = urlProps.getProperty(Driver.HOST_PROPERTY_KEY);
    String port = urlProps.getProperty(Driver.PORT_PROPERTY_KEY);
View Full Code Here

  public void testBug63284() throws Exception {
    Properties props = new Driver().parseURL(BaseTestCase.dbUrl, null);
    props.setProperty("autoReconnect", "true");
    props.setProperty("socketFactory", "testsuite.UnreliableSocketFactory");

    Properties urlProps = new NonRegisteringDriver().parseURL(
            BaseTestCase.dbUrl, null);

    String host = urlProps.getProperty(Driver.HOST_PROPERTY_KEY);
    String port = urlProps.getProperty(Driver.PORT_PROPERTY_KEY);
View Full Code Here

        ForcedLoadBalanceStrategy.class.getName());
    props.setProperty("loadBalanceBlacklistTimeout", "5000");
    props.setProperty("loadBalancePingTimeout", "100");
    props.setProperty("loadBalanceValidateConnectionOnSwapServer", "true");

    String portNumber = new NonRegisteringDriver().parseURL(dbUrl, null)
        .getProperty(NonRegisteringDriver.PORT_PROPERTY_KEY);

    if (portNumber == null) {
      portNumber = "3306";
    }
View Full Code Here

    if (versionMeetsMinimum(5, 6, 10)) {
      Connection testConn = null;
      Statement testSt = null;
      ResultSet testRs = null;

      Properties urlProps = new NonRegisteringDriver().parseURL(dbUrl, null);
      String dbname = urlProps.getProperty(Driver.DBNAME_PROPERTY_KEY);

      try {

        this.stmt.executeUpdate("grant all on `"+dbname+"`.* to 'must_change1'@'%' IDENTIFIED BY 'aha'");
View Full Code Here

   *
   * @throws Exception
   */
  public void testBug16224249() throws Exception {

    Properties props = new NonRegisteringDriver().parseURL(dbUrl, null);
    String host = props.getProperty(NonRegisteringDriver.HOST_PROPERTY_KEY, "localhost");
    String port = props.getProperty(NonRegisteringDriver.PORT_PROPERTY_KEY, "3306");
    String hostSpec = host;
    if (!NonRegisteringDriver.isHostPropertiesList(host)) {
      hostSpec = host + ":" + port;
    }

    String database = props.getProperty(NonRegisteringDriver.DBNAME_PROPERTY_KEY);
    removeHostRelatedProps(props);
    props.remove(NonRegisteringDriver.DBNAME_PROPERTY_KEY);

    StringBuilder configs = new StringBuilder();
    for (@SuppressWarnings("rawtypes")
    Map.Entry entry : props.entrySet()) {
      configs.append(entry.getKey());
      configs.append("=");
      configs.append(entry.getValue());
      configs.append("&");
    }

    String loadbalanceUrl = String.format("jdbc:mysql:loadbalance://%s,%s/%s?%s", hostSpec, hostSpec, database, configs.toString());
    String failoverUrl = String.format("jdbc:mysql://%s,%s/%s?%s", hostSpec, "127.0.0.1:"+port, database, configs.toString());

    Connection[] loadbalancedconnection = new Connection[] {
        new NonRegisteringDriver().connect(loadbalanceUrl, null),
        new NonRegisteringDriver().connect(loadbalanceUrl, null),
        new NonRegisteringDriver().connect(loadbalanceUrl, null)
        };

    Connection[] failoverconnection = new Connection[] {
        new NonRegisteringDriver().connect(failoverUrl, null),
        new NonRegisteringDriver().connect(failoverUrl, null),
        new NonRegisteringDriver().connect(failoverUrl, null)
        };

    // WebLogic-style test
    Class<?> mysqlCls = null;
    Class<?> jcls = failoverconnection[0].getClass(); // the driver-level connection, a Proxy in this case...
View Full Code Here

        ForcedLoadBalanceStrategy.class.getName());
    props.setProperty("loadBalancePingTimeout", "100");
    props.setProperty("autoReconnect", "true");
   

    String portNumber = new NonRegisteringDriver().parseURL(dbUrl, null)
        .getProperty(NonRegisteringDriver.PORT_PROPERTY_KEY);

    if (portNumber == null) {
      portNumber = "3306";
    }
View Full Code Here

  public void testBug6966() throws Exception {
    Properties props = new Driver().parseURL(BaseTestCase.dbUrl, null);
    props.setProperty("autoReconnect", "true");
    props.setProperty("socketFactory", "testsuite.UnreliableSocketFactory");

    Properties urlProps = new NonRegisteringDriver().parseURL(dbUrl,
        null);

    String host = urlProps.getProperty(Driver.HOST_PROPERTY_KEY);
    String port = urlProps.getProperty(Driver.PORT_PROPERTY_KEY);
View Full Code Here

TOP

Related Classes of com.mysql.jdbc.NonRegisteringDriver

Copyright © 2018 www.massapicom. 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.