2016-03-26 27 views
1

Bir web sunucusu projesinde tomact ile çalışıyorum. Neo4j'de bir veri bankam var. Bunu veri tabanına nasıl bağlarım? Buradan bilgi almak ve oluşturduğum servletlerde yeni veri eklemek istiyorum. DataBase'i arka planda çalıştırmayı denedim ama hala projemde "Yasak (403) - Yasak" ı buluyorum. Bir şekilde ayarlamalı mıyım? Tutulma kullanıyorum, bunu nasıl yapabilirim?Tutulma projesinde neo4j veri tabanını kullanma

Bu yaklaşım deneyebilirsiniz

cevap

0

:

import org.neo4j.graphdb.GraphDatabaseService; 
import org.neo4j.graphdb.Node; 
import org.neo4j.graphdb.Transaction; 
import org.neo4j.graphdb.factory.GraphDatabaseFactory; 

// ... 

public static void main(String[] args) { 
     GraphDatabaseFactory graphDbFactory = new GraphDatabaseFactory(); 
     GraphDatabaseService graphDb = graphDbFactory.newEmbeddedDatabase("path_to_neo4j_database/your_database_folder"); 
     try (Transaction tx = graphDb.beginTx()) { 
      // use graphDb object to manipulate the DB content 
      tx.success(); 
     } 
     graphDb.shutdown(); 
     System.out.println("Done :) "); 
} 
// ... 

Ve yol inşa etmek Neo4j kütüphanesini eklemeyi unutma:

don't forget to add the Neo4j library to build path

İlgili konular