neo4j / neo4j-jdbc Goto Github PK
View Code? Open in Web Editor NEWOfficial Neo4j JDBC Driver
Home Page: http://neo4j.github.io/neo4j-jdbc/
License: Apache License 2.0
Official Neo4j JDBC Driver
Home Page: http://neo4j.github.io/neo4j-jdbc/
License: Apache License 2.0
The previous JDBC prefix was jdbc:neo4j:...
. I like the new Prefix with jdbc:bolt:..
and jdbc:http:..
however I'm not sure that jdbc:http:..
without any neo4j hint feels right. Maybe using jdbc:neo4j:http:..
would be better?
java.lang.UnsupportedOperationException: Method getWarnings in class org.neo4j.jdbc.Connection is not yet implemented.
at org.neo4j.jdbc.utils.ExceptionBuilder.buildUnsupportedOperationException(ExceptionBuilder.java:41)
at org.neo4j.jdbc.Connection.getWarnings(Connection.java:277)
Should at least return NULL
Debug mode was removed in RC1, because we were using mockito, and we don't want to have a test library into the package.
This is a list of solution:
My preference go to 3 or 5, and I prefer 3 to have something generic.
What do you think ?
reported by intellij
org.neo4j.jdbc.Driver - jdbc:neo4j:bolt://localhost
Method getUserName in class org.neo4j.jdbc.DatabaseMetaData is not yet implemented..
I think this is a bug, because when I disable auto commit I don't want the transaction to be marked as failure and be closed after I close a single statement...
java.lang.UnsupportedOperationException: Method getTableName in class org.neo4j.
jdbc.ResultSetMetaData is not yet implemented.
at org.neo4j.jdbc.utils.ExceptionBuilder.buildUnsupportedOperationException(ExceptionBuilder.java:41)
at org.neo4j.jdbc.ResultSetMetaData.getTableName(ResultSetMetaData.java:166)
Could return a tablename like "CypherQuery" or else
I just discovered that all artefacts are shaded by default. I personally would prefer to not doing that to not conflict with potentially other Neo4J artefacts on the classpath. But to provide a single JAR that can be used by a SQL tool that is a nice feature.
This ticket is primarily to document the decision that was taken by you and why. :-)
Yesterday I discovered that the bolt driver doesn't bind parameters defined with {1}
in a cypher query. Is this by design or is this a bug? The 2.x driver bound these without any problems and it seems the new bolt driver just binds ?
-Parameters.
It seems that with the new JDBC driver for Neo4j 3.0.x, the in memory database is not working:
jdbc:neo4j:mem:mydb
jdbc:neo4j:file:/home/user/neo/graph.db
as described in https://github.com/neo4j-contrib/neo4j-jdbc-2x.
Is there any plan to support these? They are very convenient for unit/integration testing.
Thanks
It seems during shading only the BoltDriver survives. The shade plugin needs to be configured to merge both files.
The error message when the JDBC connection string is not correct is weirdly phrased:
Caused by: java.sql.SQLException: JDBC url is not bad
at org.neo4j.jdbc.http.HttpDriver.connect(HttpDriver.java:59)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
Best would be to give a few examples of correct connection strings.
https://github.com/fbiville/liquigraph/issues/82 reveals that for the last Liquigraph changeset insertion into Liquigraph history graph, the main thread hangs forever because it forever waits for a connection from Apache HTTP connection pool (you can see the actual main thread dump in the original issue).
This happens with the legacy JDBC driver.
Maybe it happens with the new one as well.
To emulate Liquigraph behaviour, the idea would be to hold a single JDBC connection and commit several transactions during that time. The test input Liquigraph data roughly inserts ~100 nodes and connections (via MERGE
) in ~30 transactions when the exhaustion kicks in.
I can share the input data privately if it helps.
Instead, an exception will be thrown if called when it's already closed.
Therefore, the following code used to work with the legacy JDBC driver, won't work now:
try (Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(query)) {
// do something with resultset
}
Statement
closes ResultSet
first and ResultSet
explicit close will fail.
relative numbers compare with neo4j-java-driver
some absolute numbers for the publication
This allows e.g. using Microsoft office to access Neo4j.
In IntelliJ
MATCH (n:Person)-[r:ACTED_IN]->(m:Movie)
RETURN n,r,m
only has this for n
{born=1964, name=Keanu Reeves, _id=11177, _labels=[Person]}
for r
, and m
both are null
the separate, generated columns all are filled with valid values.
Error: Neo4j 3.0 Bolt: java.lang.UnsupportedOperationException: Method supportsStoredProcedures in class org.neo4j.jdbc.DatabaseMetaData is not yet implemented.
In SquirrelSQL
Error: neo4j-test: java.lang.UnsupportedOperationException: Method supportsStoredProcedures in class org.neo4j.jdbc.DatabaseMetaData is not yet implemented.
as you can see on the neo4j browser:
org.neo4j.driver.v1.exceptions.ClientException: You cannot begin a transaction on a session with an open transaction; either run from within the transaction or use a different session.
at org.neo4j.driver.internal.InternalSession.ensureNoOpenTransactionBeforeOpeningTransaction(InternalSession.java:196)
at org.neo4j.driver.internal.InternalSession.ensureConnectionIsValidBeforeOpeningTransaction(InternalSession.java:167)
at org.neo4j.driver.internal.InternalSession.beginTransaction(InternalSession.java:135)
at org.neo4j.jdbc.bolt.BoltDatabaseMetaData.(BoltDatabaseMetaData.java:40)
at org.neo4j.jdbc.bolt.BoltDatabaseMetaData.(BoltDatabaseMetaData.java:54)
at org.neo4j.jdbc.bolt.BoltConnection.getMetaData(BoltConnection.java:80)
at org.neo4j.jdbc.bolt.BoltConnection.getMetaData(BoltConnection.java:34)
at net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData.privateGetJDBCMetaData(SQLDatabaseMetaData.java:1926)
at net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData.supportsSchemasInDataManipulation(SQLDatabaseMetaData.java:339)
at net.sourceforge.squirrel_sql.fw.sql.DatabaseObjectInfo.generateQualifiedName(DatabaseObjectInfo.java:197)
at net.sourceforge.squirrel_sql.fw.sql.DatabaseObjectInfo.(DatabaseObjectInfo.java:77)
at net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeModel$RootNode.createDbo(ObjectTreeModel.java:381)
at net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeModel$RootNode.(ObjectTreeModel.java:376)
at net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeModel.createRootNode(ObjectTreeModel.java:271)
at net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeModel.(ObjectTreeModel.java:87)
at net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTree.(ObjectTree.java:125)
at net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreePanel.createGUI(ObjectTreePanel.java:906)
at net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreePanel.(ObjectTreePanel.java:131)
at net.sourceforge.squirrel_sql.client.session.mainpanel.ObjectTreeTab.getComponent(ObjectTreeTab.java:83)
at net.sourceforge.squirrel_sql.client.gui.session.MainPanel.addMainPanelTab(MainPanel.java:202)
at net.sourceforge.squirrel_sql.client.gui.session.MainPanel.(MainPanel.java:109)
at net.sourceforge.squirrel_sql.client.gui.session.MainPanelFactory.createMainPanel(MainPanelFactory.java:27)
at net.sourceforge.squirrel_sql.client.gui.session.SessionPanel.createGUI(SessionPanel.java:466)
at net.sourceforge.squirrel_sql.client.gui.session.SessionPanel.initialize(SessionPanel.java:116)
at net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame.createGUI(SessionInternalFrame.java:123)
at net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame.(SessionInternalFrame.java:53)
at net.sourceforge.squirrel_sql.client.gui.WindowManager.createInternalFrame(WindowManager.java:405)
at net.sourceforge.squirrel_sql.client.mainframe.action.ConnectToAliasCommand$Runner.run(ConnectToAliasCommand.java:394)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at net.sourceforge.squirrel_sql.client.Main$1.dispatchEvent(Main.java:99)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227)
at java.awt.Dialog.show(Dialog.java:1084)
at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:869)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:666)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:637)
at net.sourceforge.squirrel_sql.client.session.Session$3.run(Session.java:1054)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at net.sourceforge.squirrel_sql.client.Main$1.dispatchEvent(Main.java:99)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
I expected JMH to be in test scope but found in it provided. Maybe there is a reason for that?
I also dislike the fixing to a scope in dependencyManagement but that is maybe just me.
PLEASE NOTE: It has been tested on MAC OS X El Capitan 10.11.5
OpenOffice \ Preferences
menuOptions - OpenOffice
popup window, select in the tree OpenOffice > Java
Class Path
buttonAdd an archive
and select the JDBC driverMATCH (a:Person {name: "Tom Hanks"})-[r:ACTED_IN]->(m:Movie)
RETURN a.name, r.roles, m.title
:
returned as nulll
actor.name r.roles movie.title
---------------------------------------------------------------------------------------------
Tom Hanks <null> That Thing You Do
Tom Hanks <null> Joe Versus the Volcano
Tom Hanks <null> Sleepless in Seattle
Tom Hanks <null> You've Got Mail
Tom Hanks <null> Charlie Wilson's War
Tom Hanks <null> The Polar Express
Compute virtual column for nodes & relations can't be correctly implemented on a JDBC driver, because we will need to make a full scan on the result to compute the list of all column available (a result is a collection of static tuples).
For example if you make this query on the Movie graph MATCH (n)-[r]->(m) RETURN n,r,m
you will have on n
some Movie
& Person
nodes, that haven't the same properties (it's the same for m & r).
Moreover, because Neo4j is schemaless, two Movie
nodes can have different properties. So it's impossible to compute the ResultSet column, without to make a result full scan before.
From my POV, on complexe object, we need to return an Object : we can cast InternalNode
, InternalRelationship
& InternalPath
to a POJO.
(it's related to #43).
I expected that
Statement stmt = connection.createStatement(); stmt.executeQuery("fooBar"):
throws an SQLException but instead a Neo4J Internal Exception is thrown.
See https://github.com/mvitz/neo4j-jdbc/commit/53eb06f207c5a7f5bff108786033ee30fe76046a for a failing test.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.