import java.sql.*; public class Neo4jJDBCDemo { public static void main(String[] args) { try (Connection connection = DriverManager.getConnection("jdbc:neo4j:bolt://localhost", "username", "password")) { Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery("MATCH (n) RETURN n"); while (resultSet.next()) { Node node = resultSet.getObject("n", Node.class); System.out.println("Node: " + node.getId()); } } catch (SQLException e) { e.printStackTrace(); } } }


上一篇:
下一篇:
切换中文