简体   繁体   English

Neo4j 2.0与Eclipse Java

[英]Neo4j 2.0 with Eclipse Java

I want to interact with remote Neo4j server 2.0 version from Eclipse Java program. 我想与Eclipse Java程序中的远程Neo4j服务器2.0版本进行交互。 Can some one tell me,what tools and libraries do I need to achieve this. 有人可以告诉我,实现此目标需要什么工具和库。 Please note that it need to interact with remote DB server and not the embedded Noe4j. 请注意,它需要与远程数据库服务器而不是嵌入式Noe4j进行交互。 Please advise. 请指教。

Check out the Neo4j JDBC driver. 检查Neo4j JDBC驱动程序。 That should work best for your purposes: 那应该最适合您的目的:

https://github.com/neo4j-contrib/neo4j-jdbc/tree/2.0 https://github.com/neo4j-contrib/neo4j-jdbc/tree/2.0

If you've worked with a JDBC driver before it should be as easy. 如果您之前使用过JDBC驱动程序,那么它应该同样容易。 Just make sure to use parametrized PreparedStatement for your queries. 只需确保对您的查询使用参数化的PreparedStatement

There are a few other options as well: 还有其他一些选择:

  1. The native Neo4j REST API. 本机Neo4j REST API。 Docs are here: http://docs.neo4j.org/chunked/stable/rest-api.html and an example is here: https://github.com/jimwebber/neo4j-tutorial/blob/master/src/koan/java/org/neo4j/tutorial/advanced/BasicRestApiFormerlyKoan10.java (check out the entire Koan project; it's a fantastic way to get really familiar with Neo4j's Java libs). 文件在这里: http : //docs.neo4j.org/chunked/stable/rest-api.html ,例子在这里: https : //github.com/jimwebber/neo4j-tutorial/blob/master/src/koan /java/org/neo4j/tutorial/advanced/BasicRestApiFormerlyKoan10.java (查看整个Koan项目;这是一种非常熟悉Neo4j的Java库的绝妙方法)。 The example makes use of a Jersey client to call out to the Neo4j server. 该示例利用Jersey客户端调出Neo4j服务器。

  2. https://github.com/neo4j/java-rest-binding - The URL should speak for itself. https://github.com/neo4j/java-rest-binding-URL应该说明一切。 There are tags for Neo4j 2.0 as well. 也有Neo4j 2.0的标签。 This binding essentially wraps the above in a nice, neat package. 这种绑定本质上将以上内容包装在一个漂亮,整洁的程序包中。 Beats having to write your own wrapper. 无需编写自己的包装器。

  3. Spring Data for Neo4j ( http://projects.spring.io/spring-data-neo4j/ ). Neo4j的Spring数据( http://projects.spring.io/spring-data-neo4j/ )。 If you're using Spring in your Java development, this is definitely worth a look. 如果您在Java开发中使用Spring,那么绝对值得一看。 The update for Neo4j 2.0 just came out a few weeks ago and should be ready for production very soon. Neo4j 2.0的更新是在几周前发布的,应该很快就可以投入生产。 There are pros and cons to using SDN, but, it's super easy to use, especially if you don't need anything overly complicated. 使用SDN具有优缺点,但是,它非常易于使用,尤其是在您不需要任何过于复杂的东西的情况下。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM