Java 8 Driver - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Driver class.

This code example shows how to use the following methods: connect
 
	@Override 
	protected Connection getConnectionFromDriver(Properties props) throws SQLException {
		Driver driver = getDriver();
		String url = getUrl();
		Assert.notNull(driver, "Driver must not be null");
		if (logger.isDebugEnabled()) { 
			logger.debug("Creating new JDBC Driver Connection to [" + url + "]");
		} 
		return driver.connect(url, props);
	} 
 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: acceptsURL
	@Test 
	public void shouldAcceptsWellFormattedURLOnly() throws ClassNotFoundException, SQLException { 
 
		Driver drv = new OrientJdbcDriver();
 
		assertTrue(drv.acceptsURL("jdbc:orient:local:./working/db/test"));
 
		assertFalse(drv.acceptsURL("local:./working/db/test"));
	} 
 
	@Test 
	public void shouldConnect() throws SQLException { 
 
		Properties info = new Properties();
		info.put("user", "admin");
		info.put("password", "admin");
 
		OrientJdbcConnection conn = (OrientJdbcConnection) DriverManager.getConnection("jdbc:orient:memory:test", info);
 
		assertNotNull(conn);
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getClass, getMajorVersion, getMinorVersion, jdbcCompliant
        final Class<? extends Driver> driverClass = classloader.loadClass( this.adapter.getDriverClassName() ).asSubclass( Driver.class );
        return driverClass.newInstance();
    } 
 
    protected InstalledDriver createInstalledDriver() { 
        int major = this.driver.getMajorVersion();
        int minor = this.driver.getMinorVersion();
        boolean compliant = this.driver.jdbcCompliant();
        return new InstalledDriver(this.adapter.getId(), this.driver.getClass().getName(), null, null, major, minor, compliant );
    } 
 
    @Override 
    public Driver getValue() throws IllegalStateException, IllegalArgumentException {
        return this.driver;
    } 
 
    public Injector<DriverRegistry> getDriverRegistryInjector() { 
        return this.driverRegistryInjector;
    } 
 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getClass, getMajorVersion, getMinorVersion
		} 
		 
		Class<?> driverClass = Class.forName(args[0]);
		Driver d = (Driver)driverClass.newInstance();
		 
		System.out.println("Driver class: "+d.getClass().getName());
		System.out.println("Driver Major Version: "+d.getMajorVersion());
		System.out.println("Driver Minor Version: "+d.getMinorVersion());		
	} 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: connect
                props.setProperty("user", user);
            } 
            if (password != null) {
                props.setProperty("password", password);
            } 
            Connection connection = driver.connect(url, props);
             
            return connection;
        } catch (Exception e) {
            throw new SQLException(e);
        } 
    } 
 
    @Override 
    public void shutdown() throws SQLException {
  
    } 
 
    public String getDriverClassName() {
        return driverClassName;
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Java 8 Driver Methods: