本来想说点儿前言,奈何今天口干,算了,步骤看注解吧!
public static void main(String[] args) throws SQLException {
//将要导入的数据先查出来放入内存中
List<Map<String, String>> martLogData = GBaseConnection.getMartLogData();
System.out.println("1、数据条数: " + martLogData.size());
//创建Neo4j链接
Driver driver = GraphDatabase.driver("bolt://ip:7687", AuthTokens.basic("neo4j", "*******"));
Session session=driver.session();
//先删除该 Label 数据
String deleteCQL = "match (n:MartLogMapping) detach delete n";
session.run(deleteCQL);
//开启秒表
StopWatch stopWatch = new StopWatch();
stopWatch.start("task");
// 手动create data to neo4j
String createCQLTemplate = "create (n:MartLogMapping {userName: '$userName', logName: '$log_name', databaseName: '$databaseName', w