简体   繁体   中英

No suitable driver found for jdbc Neo4j

I already checked the other question about my issue, but none of them solved. I imported the Neo4j Jar by configuring the build path, but still I get this error.

 import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class TestNeo4j { public static void main(String[] args) throws SQLException { Connection c = DriverManager.getConnection("jdbc:neo4j://localhost:7474/", "neo4j", "neo4j"); Statement st = c.createStatement(); String cql = "match (m)-[:IS_ALLERGIC_TO]->(n:Product) where n.name = 'gluten' return m.name"; ResultSet rs = st.executeQuery(cql); while(rs.next()) System.out.println(rs.getString(1)); c.close(); } } 

This is my code. Can you figure out what the problem is?

As suggested here , use neo4j jar with dependencies (neo4j-jdbc-2.1.4-jar- with-dependencies .jar).

You can grab it from neo4j release repository, here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM