您的位置:首页 > 移动开发

Neo4j Movies Demo App in java with jdbc

2017-11-23 16:08 295 查看
Neo4j官方网站

在官方网站中看到有一个适合初学者学习的web demo  传送门:Using Neo4j from Java

Neo4j的示例web项目。前端页面实现电影搜索,电影的细节,和演员和电影的图可视化。每个后端实现显示如何连接到Neo4j不同的搜索语言和驱动程序。

官网上是这样说的:

The Example Project
The Neo4j example project is a small, one page webapp for the movies database built into the Neo4j tutorial.The front-end
page is the same for all drivers: movie search, movie details, and a graph visualization of actors and movies.Each backend implementation shows you how to connect to Neo4j from each of the different languages and drivers.
You can learn more about our small, consistent example project across many different language drivershere.You
will find the implementations for all drivers asindividual GitHub repositories,
which you can clone and deploy directly.

那就到github中下载这个案例吧,传送门:Neo4j Movies Demo App in java with jdbc

官网上有详细的步骤:点击打开链接

将github的Maven项目先下载下来解压导入ide中(我的是eclipse)

同时,创建一个新的No4j的数据库
执行命令
:play movies
很快案例所需要的电影的数据就导入到了数据库中
项目导入完成,Maven已经将所需要的jar下载好了
这时,eclipse报错:



说需要scala-lang的jar,于是我到Mavenrepository找到它的依赖

1
2
3
4
5
6
         <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>2.10.2</version>
        </dependency>
    
但是错误还是没有消失,于是我试着换了比较新的版本2.11.11错误消失了。

然后选择Maven =》 Update Project,项目已经准备就绪,就差运行了。

运行前要将compile exec:java中的username,paasword换成自己的账号密码,否则会报错提示没有权限

官方提示项目所需jdk最好为1.8,所以我将porm文件中的jdk版本从1.7改为了1.8,

github上的提示是运行compile exec:java命令,运行这个命令服务启动正常,

访问http://localhost:8080



下面就可以研究这个demo了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐