Faquarl
Faquarl

Reputation: 158

Error Running Neo4j JDBC Example

I have some trouble running the example from Neo4j java jdbc. I am following the instruction from :GitHub Neo4j-JDBC But, when I arrive at :

mvn compile exec:java

I have a built error:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project neo4j-movies: An exception occured while executing the Java class. null: InvocationTargetException: Unauthorized -> [Help 1]

How can I solve this?

Upvotes: 1

Views: 442

Answers (1)

Michael Hunger
Michael Hunger

Reputation: 41676

Disable auth in your server or provide the credentials to the JDBC driver as connection properties.

Properties props = new Properties()
props.setProperty("user","neo4j");
props.setProperty("password","secret");

Connection con = DriverManager.getConnection("jdbc:neo4j://localhost:7474/",props);

Upvotes: 1

Related Questions