Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Neo4j-服务器为URL返回了HTTP响应代码:500:http://localhost:7474/db/data/cypher_Java_Neo4j_Cypher - Fatal编程技术网

Java Neo4j-服务器为URL返回了HTTP响应代码:500:http://localhost:7474/db/data/cypher

Java Neo4j-服务器为URL返回了HTTP响应代码:500:http://localhost:7474/db/data/cypher,java,neo4j,cypher,Java,Neo4j,Cypher,我在使用HTTPConnection运行cypher时遇到以下异常 服务器为URL返回了HTTP响应代码:500: 若我用单引号传递cypher中的值,它将工作并获取输出对象 String query=“匹配(用户:用户{id:\'Sree\'})返回用户” 有什么建议吗?提前谢谢你 我觉得这很傻 代码中的一个小改动。将参数转换为JSONObject字符串 JSONObject jsonObject = new JSONObject(); jsonObject.put("query", quer

我在使用HTTPConnection运行cypher时遇到以下异常

服务器为URL返回了HTTP响应代码:500:

若我用单引号传递cypher中的值,它将工作并获取输出对象

String query=“匹配(用户:用户{id:\'Sree\'})返回用户”


有什么建议吗?提前谢谢你

我觉得这很傻

代码中的一个小改动。将参数转换为JSONObject字符串

JSONObject jsonObject = new JSONObject();
jsonObject.put("query", query);
String urlParameters = jsonObject.toString();
而不是

String urlParameters = "{\"query\":\"" + query + "\"}";
String urlParameters = "{\"query\":\"" + query + "\"}";