资源简介
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面试试题
- JAVA实现 中点画线算法、Bresenham画线算
- 泰牛程序员 韩顺平 JavaEE全套 第05部分
- 韩顺平JavaEE全套,第一部分:循序渐
- Qrcode.jar
- Java接口自动化测试实战.zip
- 基于Java的桌球小游戏
- Java爬虫获取网页表格数据保存到MyS
- JAVA简单的游戏登录界面
- 石大远程在线考试-《Java语言程序设计
- 数据库系统原理课程设计实验java模拟
- Java翁恺网易公开课Shapes.zip
- 通讯录管理系统(java+sql)
- Java Cipher
- java编写的计算器,实现windows标准型计
- java 拼图游戏源代码
- Java企业微信通用开发配置源代码
- 进程调度的设计与实现有GUI java
- 基于Java的SNMP网络管理系统
- java 使用jna开启关闭第三方应用程序
- java单机斗地主
- Java语言实现的矩阵的基本运算矩阵的
- Java版推箱子搬箱子游戏开发入门及源
- java操作word书签
- java版简易人事管理系统
- java地铁票价计算器dijkstra算最短路径
- 银行家算法Java
- JAVA实现计算立体图形体积、面积,通
- 银行家算法java实现带UI界面
- 故障树JAVA源代码
评论
共有 条评论