import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Label; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Transaction; import org.neo4j.graphdb.factory.GraphDatabaseFactory; public class tests { public enum nodetype implements Label { Student,teacher; } public static void main(String[] args) { GraphDatabaseFactory dbfactory=new GraphDatabaseFactory(); GraphDatabaseService graphdb =dbfactory.newEmbeddedDatabase("C:\\Users\\Zigzago\\.Neo4jDesktop\\neo4jDatabases\\database-f308fc06-68df-4463-841d-fb3ab98b1b08\\installation-3.3.3\\data\\databases\\graph.db"); try(Transaction tx=graphdb.beginTx()) { Node s= graphdb.createNode(nodetype.Student); s.setProperty("Pid",5001); tx.success(); } catch (Exception ex) { String message = ex.getMessage(); } graphdb.shutdown(); } }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0 <groupid>com.mycompany <artifactid>neo4jtest <version>1.0-SNAPSHOT <packaging>jar <properties> <project.build.sourceencoding>UTF-8 <maven.compiler.source>1.8 <maven.compiler.target>1.8 <dependencies> <dependency> <groupid>org.neo4j <artifactid>neo4j <version>2.1.6
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project neo4jtest: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1] To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging. For more information about the errors and possible solutions, please read the following articles: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)