Package org.lealone.engine

Examples of org.lealone.engine.ConnectionInfo


                    filePasswordHash = (byte[]) info.get(key);
                else
                    prop.setProperty(key, info.getProperty(key));

            }
            ConnectionInfo ci = new ConnectionInfo(url, prop);
            ci.setUserPasswordHash(userPasswordHash);
            ci.setFilePasswordHash(filePasswordHash);
            sr = (SessionRemote) new SessionRemote(ci).connectEmbeddedOrServer(false);
        }

        return sr;
    }
View Full Code Here


        if (baseDir == null) {
            baseDir = SysProperties.getBaseDir();
        }

        dbName = server.checkKeyAndGetDatabaseName(dbName);
        ConnectionInfo ci = new CBaseConnectionInfo(originalURL, dbName);

        if (baseDir != null) {
            ci.setBaseDir(baseDir);
        }
        if (server.getIfExists()) {
            ci.setProperty("IFEXISTS", "TRUE");
        }
        ci.setUserName(userName);

        ci.setUserPasswordHash(userPasswordHash);
        ci.setFilePasswordHash(filePasswordHash);
        ci.readProperties(originalProperties);

        originalProperties.setProperty("user", userName);
        if (userPasswordHash != null)
            originalProperties.put("_userPasswordHash_", userPasswordHash);
        if (filePasswordHash != null)
View Full Code Here

        if (baseDir == null) {
            baseDir = SysProperties.getBaseDir();
        }

        dbName = server.checkKeyAndGetDatabaseName(dbName);
        ConnectionInfo ci = new HBaseConnectionInfo(originalURL, dbName);

        if (baseDir != null) {
            ci.setBaseDir(baseDir);
        }
        if (server.getIfExists()) {
            ci.setProperty("IFEXISTS", "TRUE");
        }
        ci.setUserName(userName);

        ci.setUserPasswordHash(userPasswordHash);
        ci.setFilePasswordHash(filePasswordHash);
        ci.readProperties(originalProperties);

        originalProperties.setProperty("user", userName);
        if (userPasswordHash != null)
            originalProperties.put("_userPasswordHash_", userPasswordHash);
        if (filePasswordHash != null)
            originalProperties.put("_filePasswordHash_", filePasswordHash);

        if (server.getMaster() != null)
            ci.setProperty("SERVER_TYPE", "M");
        else if (server.getRegionServer() != null)
            ci.setProperty("SERVER_TYPE", "RS");
        HBaseSession session = (HBaseSession) HBaseDatabaseEngine.getInstance().createSession(ci);
        session.setMaster(server.getMaster());
        session.setRegionServer(server.getRegionServer());
        session.setOriginalProperties(originalProperties);
View Full Code Here

        } else {
            host = server.getRegionServer().getServerName().getHostname();
            port = ZooKeeperAdmin.getTcpPort(server.getRegionServer().getServerName());
        }
        String url = Constants.URL_PREFIX + Constants.URL_TCP + "//" + host + ":" + port + "/" + databaseName;
        ConnectionInfo ci = new HBaseConnectionInfo(url, databaseName);

        if (baseDir != null) {
            ci.setBaseDir(baseDir);
        }
        if (server.getIfExists()) {
            ci.setProperty("IFEXISTS", "TRUE");
        }

        ci.setUserName(userName);
        ci.setProperty("MODE", "PostgreSQL");

        ci.setUserPasswordHash(userPasswordHash);
        ci.setFilePasswordHash(null);

        if (server.getMaster() != null)
            ci.setProperty("SERVER_TYPE", "M");
        else if (server.getRegionServer() != null)
            ci.setProperty("SERVER_TYPE", "RS");
        HBaseSession session = (HBaseSession) HBaseDatabaseEngine.getInstance().createSession(ci);
        session.setMaster(server.getMaster());
        session.setRegionServer(server.getRegionServer());
        session.setOriginalProperties(originalProperties);
        ci.setSession(session);

        return new JdbcConnection(ci, false);
    }
View Full Code Here

        Properties info = new Properties();
        info.put("MODE", "PostgreSQL");
        info.put("USER", userName);
        info.put("PASSWORD", password);
        String url = Constants.URL_PREFIX + databaseName;
        ConnectionInfo ci = new ConnectionInfo(url, info);
        String baseDir = server.getBaseDir();
        if (baseDir == null) {
            baseDir = SysProperties.getBaseDir();
        }
        if (baseDir != null) {
            ci.setBaseDir(baseDir);
        }
        if (server.getIfExists()) {
            ci.setProperty("IFEXISTS", "TRUE");
        }

        return new JdbcConnection(ci, false);
    }
View Full Code Here

        String baseDir = server.getBaseDir();
        if (baseDir == null) {
            baseDir = SysProperties.getBaseDir();
        }
        dbName = server.checkKeyAndGetDatabaseName(dbName);
        ConnectionInfo ci = new ConnectionInfo(originalURL, dbName);
        ci.setUserName(userName);
        ci.setUserPasswordHash(transfer.readBytes());
        ci.setFilePasswordHash(transfer.readBytes());
        int len = transfer.readInt();
        for (int i = 0; i < len; i++) {
            ci.setProperty(transfer.readString(), transfer.readString());
        }
        // override client's requested properties with server settings
        if (baseDir != null) {
            ci.setBaseDir(baseDir);
        }
        if (server.getIfExists()) {
            ci.setProperty("IFEXISTS", "TRUE");
        }
        try {
            return (Session) ci.getSessionFactory().createSession(ci);
        } catch (SQLException e) {
            throw DbException.convert(e);
        }
    }
View Full Code Here

    /**
     * INTERNAL
     */
    public JdbcConnection(String url, Properties info) throws SQLException {
        this(new ConnectionInfo(url, info), true);
    }
View Full Code Here

        if (baseDir == null) {
            baseDir = SysProperties.getBaseDir();
        }

        dbName = server.checkKeyAndGetDatabaseName(dbName);
        ConnectionInfo ci = new CassandraConnectionInfo(originalURL, dbName);

        if (baseDir != null) {
            ci.setBaseDir(baseDir);
        }
        if (server.getIfExists()) {
            ci.setProperty("IFEXISTS", "TRUE");
        }
        ci.setUserName(userName);

        ci.setUserPasswordHash(userPasswordHash);
        ci.setFilePasswordHash(filePasswordHash);
        ci.readProperties(originalProperties);

        originalProperties.setProperty("user", userName);
        if (userPasswordHash != null)
            originalProperties.put("_userPasswordHash_", userPasswordHash);
        if (filePasswordHash != null)
View Full Code Here

TOP

Related Classes of org.lealone.engine.ConnectionInfo

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.