cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

[Neo.ClientError.Statement.SyntaxError

Hi,
i want to use sql query too load the data from neo4j using bi connector.for that i'm using driver(neo4j-jdbc-driver-3.1.0).i am able to get the data for cipher query but not for sql query.

While running below exception is coming.please guide me so that i can achieve it.
"java.sql.SQLException: Some errors occurred :
[Neo.ClientError.Statement.SyntaxError]:Invalid input 'l': expected 't/T' (line 1, column 3 (offset: 2))"

my code:

public static void main(String[] args) {
	JDBCTest test = new JDBCTest();
	try {
		Connection con = test.connectViaDMa();
		String cypherQuery ="select * from person";
		Statement stmt = (Statement) con.createStatement();
		ResultSet rs = stmt.executeQuery(cypherQuery);
		while (rs.next()) {
			System.out.println(rs.getString("person"));
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
}
private static Connection connectViaDMa() throws Exception {
	Connection connection = null;
	String CONNECTION_URL = "jdbc:neo4j:http://localhost:7474/neo4j";
	
	Driver driver = new Driver();
	DriverManager.registerDriver(driver);
	connection = DriverManager.getConnection(CONNECTION_URL);
	System.out.println(connection.toString());

	return connection;
}

please let me know what i'm missing for this.
i am using neo database version About Neo4j Desktop
Version: 1.3.4

7 REPLIES 7

Hello @sandeep829490

String cypherQuery ="select * from person";

Is it normal that you are using an SQL query instead of a Cypher query? The error looks like a syntax error.
Try:

MATCH (n) RETURN *

Regards,
Cobra

That i knew but i want to implement bi connector so that i can get the data from neo4j using basic sql query..So please help in that what are the drivers, databases version will be required. So that i can get data using sql query too.

Hello @logan.ripplinger @neo4j_devrel
@
Can you please guide me as i want to implement bi connector so that i can get data from neo4j database using sql query.
For that i ma using simba Neo4jJDBC42 jar(version:1.0.5.1005 ) for bi connector and neo4j database of version 3.5.7 and 4.1.0 but i'm not able to load data using this driver.

Thanks
Sandeep

Hello @Cobra,
Can you please guide me as i want to implement bi connector so that i can get data from neo4j database using sql query.
For that i ma using simba Neo4jJDBC42 jar(version:1.0.5.1005 ) for bi connector and neo4j database of version 3.5.7 and 4.1.0 but i'm not able to load data using this driver.

Thanks
Sandeep

Hello @sandeep829490

I'm afraid I can't help you, I never used BI connector and I didn't know it was possible to use SQL queries as well like this

Regards,
Cobra

Hi Sandeep,

It looks like this JDBC driver is a commercial product by Simba

have you reached out to the Simba support team to ask about the version pairs (driver versus neo4j) they support? I see that announcement is dated "July 28, 2020", so I imagine not many people have experience with this driver yet.

It sounds interesting, and I'd be curious how they map sql through to cypher (in a useful graph query way).

Regards,
Joel

@sandeep829490

Your connection URL is wrong: jdbc:neo4j:http://localhost:7474/neo4j

This should be instead jdbc:neo4j://localhost

Please consult the documentation for full reference on how to create the connect string with options.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online