sumit
sumit

Reputation: 340

Not able to see created Node in Neo4j/console http://localhost:7474

I am trying Java code below and its work fine as expected but problem is i am not able to see created node in neo4j/database in localhost:7474 console. I have restarted server but still same problem,can anyone please help.And I also doubt that is these node created in system memory?

void createDb() throws IOException
{
    graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( "target/neo4j-hello-db" );
    registerShutdownHook( graphDb );
    BufferedReader CSVFile = null;
    int i=0;
    Transaction tx = graphDb.beginTx();
    try
    {
     CSVFile = new BufferedReader(new FileReader("/home/sumit/Total_Keywords(0 - 3300000).csv"));

          String dataRow = CSVFile.readLine();
    while (dataRow != null){
        i++;
     if(i==200)
         break;
    String[] dataArray = dataRow.split(",");

     for(String item:dataArray)
     {
        node = graphDb.createNode();
        node.setProperty( "name", item );
        System.out.println( node.getProperty( "name" ) );
        tx.success();
     }
     dataRow = CSVFile.readLine();
    }
    }
    finally
    {
        tx.finish();
        CSVFile.close();
    }
}

Upvotes: 3

Views: 1251

Answers (2)

Giridhar Bandi
Giridhar Bandi

Reputation: 1323

please check if the server you are looking at is pointed to correct db.

The location of the file is

conf/neo4j-server.properties

Check the following line and see if it has the correct path that you are using in your code.

org.neo4j.server.database.location=target/neo4j-hello-db

Upvotes: 2

Nicholas
Nicholas

Reputation: 7501

Are you sure both are pointing to the same directory? I see in your code above that your pointing to target/neo4j-hello-db, which by default the neo4j console directory is ../data. Either change the server directory location(done in neo4j-server.properties) or change the directory that your embedded database points to.

Upvotes: 1

Related Questions