0

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 );
4

1 回答 1

0

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

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

在 a) 的情况下,您可以使用事务 Cypher 端点,使用Neo4j JDBC 驱动程序或(从 Neo4j 开始)java bolt 驱动程序

在 b) 的情况下,您需要查看 Neo4j 的源代码以了解org.neo4j.server.Bootstrapper其派生类在做什么。有了这些,您可以在嵌入式实例之上运行您的服务器。

于 2016-02-19T08:48:30.003 回答