Package com.mysql.jdbc

Examples of com.mysql.jdbc.NonRegisteringDriver


   *
   * @throws SQLException
   *             if parsing fails
   */
  protected Properties getPropertiesFromTestsuiteUrl() throws SQLException {
    Properties props = new NonRegisteringDriver().parseURL(dbUrl, null);

    String hostname = props
        .getProperty(NonRegisteringDriver.HOST_PROPERTY_KEY);

    if (hostname == null) {
View Full Code Here


    props.remove(NonRegisteringDriver.NUM_HOSTS_PROPERTY_KEY);
  }

  protected Connection getLoadBalancedConnection(int badHostLocation, String badHost,
      Properties props) throws SQLException {
    Properties parsedProps = new NonRegisteringDriver().parseURL(dbUrl, null);
   
    String firstHost = parsedProps.getProperty(NonRegisteringDriver.HOST_PROPERTY_KEY);
   
    if (!NonRegisteringDriver.isHostPropertiesList(firstHost)) {
      String port = parsedProps.getProperty(NonRegisteringDriver.PORT_PROPERTY_KEY, "3306");
View Full Code Here

  protected Connection getUnreliableLoadBalancedConnection(String[] hostNames,
      Properties props, Set downedHosts) throws Exception {
        if(props == null){
          props = new Properties();
        }
        NonRegisteringDriver d = new NonRegisteringDriver();
        this.copyBasePropertiesIntoProps(props, d);
        props.setProperty("socketFactory", "testsuite.UnreliableSocketFactory");
        Properties parsed = d.parseURL(BaseTestCase.dbUrl, props);
        String db = parsed.getProperty(NonRegisteringDriver.DBNAME_PROPERTY_KEY);
        String port = parsed.getProperty(NonRegisteringDriver.PORT_PROPERTY_KEY);
        String host = getPortFreeHostname(props, d);
        UnreliableSocketFactory.flushAllHostLists();
        StringBuffer hostString = new StringBuffer();
View Full Code Here

  protected Connection getUnreliableReplicationConnection(String[] hostNames,
      Properties props, Set downedHosts) throws Exception {
        if(props == null){
          props = new Properties();
        }
        NonRegisteringDriver d = new NonRegisteringDriver();
        this.copyBasePropertiesIntoProps(props, d);
        props.setProperty("socketFactory", "testsuite.UnreliableSocketFactory");
        Properties parsed = d.parseURL(BaseTestCase.dbUrl, props);
        String db = parsed.getProperty(NonRegisteringDriver.DBNAME_PROPERTY_KEY);
        String port = parsed.getProperty(NonRegisteringDriver.PORT_PROPERTY_KEY);
        String host = getPortFreeHostname(props, d);
        UnreliableSocketFactory.flushAllHostLists();
        StringBuffer hostString = new StringBuffer();
View Full Code Here

   * @throws Exception
   *             if an error ocurrs.
   */
  public void testBug3554() throws Exception {
    try {
      new NonRegisteringDriver().connect(
          "jdbc:mysql://localhost:3306/?user=root&password=root",
          new Properties());
    } catch (SQLException sqlEx) {
      assertTrue(sqlEx.getMessage().indexOf("Malformed") == -1);
    }
View Full Code Here

      try {
        adminConnection = getAdminConnection();

        int bogusPortNumber = 65534;

        NonRegisteringDriver driver = new NonRegisteringDriver();

        Properties oldProps = driver.parseURL(BaseTestCase.dbUrl, null);

        String host = driver.host(oldProps);
        int port = driver.port(oldProps);
        String database = oldProps
            .getProperty(NonRegisteringDriver.DBNAME_PROPERTY_KEY);
        String user = oldProps
            .getProperty(NonRegisteringDriver.USER_PROPERTY_KEY);
        String password = oldProps
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(this.dbUrl,
        null);

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

   * @throws Exception
   */
  public void testBug23626() throws Exception {
    Class clazz = this.conn.getClass();

    DriverPropertyInfo[] dpi = new NonRegisteringDriver().getPropertyInfo(
        dbUrl, null);
    StringBuffer missingSettersBuf = new StringBuffer();
    StringBuffer missingGettersBuf = new StringBuffer();

    Class[][] argTypes = { new Class[] { String.class },
View Full Code Here

      }
    }
  }

  public void testPropertiesDescriptionsKeys() throws Exception {
    DriverPropertyInfo[] dpi = new NonRegisteringDriver().getPropertyInfo(
        dbUrl, null);

    for (int i = 0; i < dpi.length; i++) {
      String description = dpi[i].description;
      String propertyName = dpi[i].name;
View Full Code Here

    }
    return true;
  }

  public void testBug46637() throws Exception {
    NonRegisteringDriver driver = new NonRegisteringDriver();
    Properties props = new Properties();
    copyBasePropertiesIntoProps(props, driver);
    String hostname = getPortFreeHostname(props, driver);
    UnreliableSocketFactory.flushAllHostLists();
    UnreliableSocketFactory.downHost(hostname);
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.