想用Java操作Neo4j,但是用官方例子成功不了,显示连接不到数据库。
关于连接的代码片段:
public static void main(String... args)
{
SmallExample example = new SmallExample("bolt://localhost:7687", "neo4j", "123456");
example.addPerson("Ada");
example.addPerson("Alice");
example.addPerson("Bob");
example.printPeople("A");
example.getPeoplesAndRelation();
example.close();
}
报错内容:Failed to receive any data from the connected address localhost:7687. Please ensure a working connection to the database.
Neo4j开了,bolt端口号和名字也是对的,密码也是对的。
我下的是neo4j的桌面版,它的浏览器是4.1.0版本的,Neo4j-Java-drive是下的1.4.4版本的,不知道是不是这两个版本不匹配。
有没有大佬能指点下,不知道怎么办了,谢谢~