Neo4j嵌入式模式,带密码 [英] Neo4j Embedded Mode with Password

查看:200
本文介绍了Neo4j嵌入式模式,带密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以在Java应用程序中以嵌入式模式连接到Neo4j,以连接到需要用户名和密码的现有正在运行的Neo4J服务器吗?

Can you connect to Neo4j in embedded mode in a Java application to connect to an existing running Neo4J server that requires a username and password?

您如何做到的?显然,未经身份验证是:

How do you do that? Apparently without authentication it is:

graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( DB_PATH );
registerShutdownHook( graphDb );

推荐答案

Http身份验证是Neo4j服务器组件的一部分.您正在使用的代码段将运行嵌入式数据库实例.

Http authentication is part of the Neo4j server component. The code snippet that you're using runs an embedded database instance.

请澄清您的问题,如果a)您想要一些代码连接到正在运行的Neo4j远程实例,或者b)您想要运行自己的嵌入式实例并在其之上运行Web界面?

Please clarify your question if a) you want some code connecting to a running Neo4j remote instance or b) you want to run your own embedded instance and run the web interface on top of it?

如果是a),则可以使用 transactional Cypher端点,使用 Neo4j JDBC驱动程序,或(从Neo4j开始)使用

In case of a) you can either work with the transactional Cypher endpoint, use Neo4j JDBC driver or (starting with Neo4j) the java bolt driver.

对于b),您需要查看Neo4j的源代码以了解org.neo4j.server.Bootstrapper及其派生类在做什么.使用这些服务器,您可以在嵌入式实例的顶部运行服务器.

In case of b) you need to look at Neo4j's source code to understand what org.neo4j.server.Bootstrapper and its derived classes are doing. With those you can run your server on top of an embedded instance.

这篇关于Neo4j嵌入式模式,带密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆