Examples of acceptsURL()


Examples of java.sql.Driver.acceptsURL()

    }

    private static String attemptConnect(PortletRequest request, PoolData data) throws SQLException, IllegalAccessException, InstantiationException {
        Class driverClass = attemptDriverLoad(request, data);
        Driver driver = (Driver) driverClass.newInstance();
        if (driver.acceptsURL(data.url)) {
            Properties props = new Properties();
            if (data.user != null) {
                props.put("user", data.user);
            }
            if (data.password != null) {
View Full Code Here

Examples of java.sql.Driver.acceptsURL()

  private Driver findRegisteredDriver(String url) {
    for (Enumeration drivers = DriverManager.getDrivers(); drivers != null
        && drivers.hasMoreElements();) {
      Driver driver = (Driver) drivers.nextElement();
      try {
        if (driver.acceptsURL(url)) {
          return driver;
        }
      } catch (Exception e) {
      }
    }
View Full Code Here

Examples of java.sql.Driver.acceptsURL()

    }

    private static String attemptConnect(PortletRequest request, PoolData data) throws SQLException, IllegalAccessException, InstantiationException {
        Class driverClass = attemptDriverLoad(request, data);
        Driver driver = (Driver) driverClass.newInstance();
        if (driver.acceptsURL(data.url)) {
            Properties props = new Properties();
            if (data.user != null) {
                props.put("user", data.user);
            }
            if (data.password != null) {
View Full Code Here

Examples of java.sql.Driver.acceptsURL()

    }

    private static String attemptConnect(PortletRequest request, PoolData data) throws SQLException, IllegalAccessException, InstantiationException {
        Class driverClass = attemptDriverLoad(request, data);
        Driver driver = (Driver) driverClass.newInstance();
        if (driver.acceptsURL(data.url)) {
            Properties props = new Properties();
            if (data.user != null) {
                props.put("user", data.user);
            }
            if (data.password != null) {
View Full Code Here

Examples of java.sql.Driver.acceptsURL()

                driver = DriverManager.getDriver(url);
            } else {
                // Usage of DriverManager is not possible, as it does not
                // respect the ContextClassLoader
                driver = (Driver) driverFromCCL.newInstance();
                if (!driver.acceptsURL(url)) {
                    throw new SQLException("No suitable driver", "08001");
                }
            }
        } catch (Throwable t) {
            String message = "Cannot create JDBC driver of class '" +
View Full Code Here

Examples of java.sql.Driver.acceptsURL()

        println( "Driver is a " + driver.getClass().getName() );
        assertEquals( JDBC.vmSupportsJDBC4(), driver.getClass().getName().endsWith( "40" ) );

        // test that null connection URLs raise a SQLException per JDBC 4.2 spec clarification
        try {
            driver.acceptsURL( null );
            fail( "Should not have accepted a null connection url" );
        }
        catch (SQLException se) { assertSQLState( MALFORMED_URL, se ); }
        try {
            driver.connect( null, props );
View Full Code Here

Examples of java.sql.Driver.acceptsURL()

        for (int u = 0; u < urls.length;u++)
        {
            String url = urls[u];
            boolean expectedAcceptance = acceptsURLTable[u][frameworkOffset];
            boolean actualAcceptance = driver.acceptsURL(url);
            assertEquals(expectedAcceptance, actualAcceptance);
        }
    }
   
    /**
 
View Full Code Here

Examples of java.sql.Driver.acceptsURL()

    }

    private static String attemptConnect(PortletRequest request, PoolData data) throws SQLException, IllegalAccessException, InstantiationException {
        Class driverClass = attemptDriverLoad(request, data);
        Driver driver = (Driver) driverClass.newInstance();
        if (driver.acceptsURL(data.url)) {
            Properties props = new Properties();
            if (data.user != null) {
                props.put("user", data.user);
            }
            if (data.password != null) {
View Full Code Here

Examples of java.sql.Driver.acceptsURL()

    }
   
    @Test
    public void testNotAccept() throws Exception {
        Driver driver = new PhoenixDriver();
        assertFalse(driver.acceptsURL("jdbc:phoenix://localhost"));
        assertFalse(driver.acceptsURL("jdbc:phoenix:localhost;test=true;bar=foo"));
        assertFalse(driver.acceptsURL("jdbc:phoenix:localhost;test=true"));
        assertTrue(driver.acceptsURL("jdbc:phoenix:localhost:123"));
        assertTrue(driver.acceptsURL("jdbc:phoenix:localhost:123;untest=true"));
        assertTrue(driver.acceptsURL("jdbc:phoenix:localhost:123;untest=true;foo=bar"));
View Full Code Here

Examples of java.sql.Driver.acceptsURL()

   
    @Test
    public void testNotAccept() throws Exception {
        Driver driver = new PhoenixDriver();
        assertFalse(driver.acceptsURL("jdbc:phoenix://localhost"));
        assertFalse(driver.acceptsURL("jdbc:phoenix:localhost;test=true;bar=foo"));
        assertFalse(driver.acceptsURL("jdbc:phoenix:localhost;test=true"));
        assertTrue(driver.acceptsURL("jdbc:phoenix:localhost:123"));
        assertTrue(driver.acceptsURL("jdbc:phoenix:localhost:123;untest=true"));
        assertTrue(driver.acceptsURL("jdbc:phoenix:localhost:123;untest=true;foo=bar"));
        DriverManager.deregisterDriver(driver);
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.