Package com.mysql.jdbc

Examples of com.mysql.jdbc.NonRegisteringDriver


                      // work for this test
      Properties props = new Properties();
      props.setProperty("autoReconnect", "true");
      props.setProperty("failOverReadOnly", "false");

      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 testCannedConfigs() throws Exception {
    String url = "jdbc:mysql:///?useConfigs=clusterBase";

    Properties cannedProps = new NonRegisteringDriver().parseURL(url, null);

    assertTrue("true".equals(cannedProps.getProperty("autoReconnect")));
    assertTrue("false".equals(cannedProps.getProperty("failOverReadOnly")));
    assertTrue("true".equals(cannedProps
        .getProperty("roundRobinLoadBalance")));

    // this will fail, but we test that too
    url = "jdbc:mysql:///?useConfigs=clusterBase,clusterBase2";

    try {
      cannedProps = new NonRegisteringDriver().parseURL(url, null);
      fail("should've bailed on that one!");
    } catch (SQLException sqlEx) {
      assertTrue(SQLError.SQL_STATE_INVALID_CONNECTION_ATTRIBUTE
          .equals(sqlEx.getSQLState()));
    }
View Full Code Here

    assertTrue(
        "At least one connection was made with the localSocketAddress set",
        didOneWork);

    NonRegisteringDriver d = new NonRegisteringDriver();

    String hostname = d.host(d.parseURL(dbUrl, null));

    if (!hostname.startsWith(":") && !hostname.startsWith("localhost")) {

      int indexOfColon = hostname.indexOf(":");
View Full Code Here

    }

  }

  public void testNewHostParsing() throws Exception {
    Properties parsedProps = new NonRegisteringDriver().parseURL(dbUrl,
        null);
    String host = parsedProps
        .getProperty(NonRegisteringDriver.HOST_PROPERTY_KEY);
    String port = parsedProps
        .getProperty(NonRegisteringDriver.PORT_PROPERTY_KEY);
View Full Code Here

      }
    }
  }
 
  public void testIsLocal() throws Exception {
    Properties parsedProps = new NonRegisteringDriver().parseURL(dbUrl, null);
    String host = parsedProps.getProperty(NonRegisteringDriver.HOST_PROPERTY_KEY, "localhost");
   
    if (host.equals("localhost") || host.equals("127.0.0.1")) {
      // we can actually test this
      assertTrue(((com.mysql.jdbc.ConnectionImpl) this.conn).isServerLocal());
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(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

    Connection _conn = null;

    try {
     
      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 db = props.getProperty(NonRegisteringDriver.DBNAME_PROPERTY_KEY,  "test");

      String hostSpec = host;
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.