资源简介
Neo4j入门的基础小程序,java实现,代码简单易懂(注意安装neo4j2.0,netBeans打开,并且导入工程中的包)带基本界面,实现excel通讯录导入和查找。暂时是最基础的版本,后期版本是美化界面并且添加了插入删除等功能的,等待稍迟些上传,本人新手,大家包涵。

代码片段和文件信息
/**
* Licensed to Neo Technology under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership. Neo Technology licenses this file to you under
* the Apache License Version 2.0 (the “License“); you may not use this file
* except in compliance with the License. You may obtain a copy of the License
* at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.neo4j.examples;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import jxl.*;
import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
import static org.neo4j.helpers.collection.IteratorUtil.iterator;
import org.neo4j.kernel.impl.util.FileUtils;
public class Neo4j {
private static final String DB_PATH = “E:\\学习\\作业“;//数据库路径
// public String greeting;
// START SNIPPET: vars
GraphDatabaseService graphDb;
public GraphDatabaseService getGraphDataba() {
return graphDb;
}
Relationship relationship;
// END SNIPPET: vars
Sheet sheet;
NewJframe njf;
// START SNIPPET: createReltype
private static enum RelTypes implements RelationshipType {
KNOWS
}
// END SNIPPET: createReltype
//
// public Neo4j(Sheet sheetTemp){
//
//
// createDb(sheetTemp);
//// hello.removeData();
//// shutDown();
// }
public void createDb(Sheet sheetTemp) {
clearDb();
// START SNIPPET: startDb
sheet = sheetTemp;
graphDb = new GraphDatabaseFactory().newembeddedDatabase(DB_PATH);
registerShutdownHook(graphDb);
// END SNIPPET: startDb
// START SNIPPET: transaction
try (Transaction tx = graphDb.beginTx()) {
// Database operations go here
// END SNIPPET: transaction
// START SNIPPET: addData
if (sheet.getRows() > 1 && sheet.getColumns() > 1) {
Node person[] = new Node[sheet.getRows()];
Cell cell[][] = new Cell[sheet.getRows()][sheet.getColumns()];
for (int i = 0; i < sheet.getRows(); i++) {
for (int j = 0; j < sheet.getColumns(); j++) {
cell[i][j] = sheet.getCell(j i);
}
}
person[1] = grap
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 725735 2009-10-24 10:11 Neo4j\jxl.jar
文件 0 2013-12-12 00:13 Neo4j\Neo4j\build\classes\.netbeans_automatic_build
文件 0 2013-12-12 00:13 Neo4j\Neo4j\build\classes\.netbeans_update_resources
文件 117 2013-12-12 00:13 Neo4j\Neo4j\build\classes\em
文件 744 2013-12-14 09:21 Neo4j\Neo4j\build\classes\org\neo4j\examples\CalculateShortestPath$1.class
文件 3032 2013-12-14 09:21 Neo4j\Neo4j\build\classes\org\neo4j\examples\CypherSql$1.class
文件 696 2013-12-14 09:21 Neo4j\Neo4j\build\classes\org\neo4j\examples\CypherSql$TestData.class
文件 771 2013-12-14 09:21 Neo4j\Neo4j\build\classes\org\neo4j\examples\em
文件 1173 2013-12-14 09:21 Neo4j\Neo4j\build\classes\org\neo4j\examples\em
文件 739 2013-12-15 21:17 Neo4j\Neo4j\build\classes\org\neo4j\examples\Neo4j$1.class
文件 1109 2013-12-15 21:17 Neo4j\Neo4j\build\classes\org\neo4j\examples\Neo4j$RelTypes.class
文件 5090 2013-12-15 21:17 Neo4j\Neo4j\build\classes\org\neo4j\examples\Neo4j.class
文件 812 2013-12-15 21:31 Neo4j\Neo4j\build\classes\org\neo4j\examples\NewJfr
文件 812 2013-12-15 21:31 Neo4j\Neo4j\build\classes\org\neo4j\examples\NewJfr
文件 768 2013-12-15 21:31 Neo4j\Neo4j\build\classes\org\neo4j\examples\NewJfr
文件 812 2013-12-15 21:31 Neo4j\Neo4j\build\classes\org\neo4j\examples\NewJfr
文件 812 2013-12-15 21:31 Neo4j\Neo4j\build\classes\org\neo4j\examples\NewJfr
文件 1669 2013-12-15 21:31 Neo4j\Neo4j\build\classes\org\neo4j\examples\NewJfr
文件 11002 2013-12-15 21:31 Neo4j\Neo4j\build\classes\org\neo4j\examples\NewJfr
文件 8469 2013-12-15 21:31 Neo4j\Neo4j\build\classes\org\neo4j\examples\NewJfr
文件 841 2013-12-14 09:21 Neo4j\Neo4j\build\classes\org\neo4j\examples\NewMatrix$1.class
文件 1251 2013-12-14 09:21 Neo4j\Neo4j\build\classes\org\neo4j\examples\NewMatrix$RelTypes.class
文件 1217 2013-12-14 09:21 Neo4j\Neo4j\build\classes\org\neo4j\examples\TraversalExample$Rels.class
文件 3600 2013-12-12 00:12 Neo4j\Neo4j\build.xm
文件 85 2013-12-12 00:12 Neo4j\Neo4j\manifest.mf
文件 78950 2013-12-12 00:12 Neo4j\Neo4j\nbproject\build-impl.xm
文件 475 2013-12-12 00:12 Neo4j\Neo4j\nbproject\genfiles.properties
文件 0 2013-12-12 00:13 Neo4j\Neo4j\nbproject\private\config.properties
文件 283 2013-12-14 22:22 Neo4j\Neo4j\nbproject\private\private.properties
文件 489 2013-12-15 21:40 Neo4j\Neo4j\nbproject\private\private.xm
............此处省略200个文件信息
相关资源
- 微博系统(Java源码,servlet+jsp),适
- java串口通信全套完整代码-导入eclip
- jsonarray所必需的6个jar包.rar
- 三角网构TIN生成算法,Java语言实现
- java代码编写将excel数据导入到mysql数据
- Java写的cmm词法分析器源代码及javacc学
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
- Java 文件加密传输
- java做的房产管理系统
- 基于jsp的bbs论坛 非常详细
评论
共有 条评论