neo4j-contrib / neo4j-apoc-procedures

Awesome Procedures On Cypher for Neo4j - codenamed "apoc"                     If you like it, please ★ above ⇧            
https://neo4j.com/labs/apoc
Apache License 2.0
1.71k stars 494 forks source link

special character in password for apoc.load.jdbc URL in configuration file #1459

Closed sandipshinde closed 4 years ago

sandipshinde commented 4 years ago

Hi,

I have a wearied scenario to handle the special characters in the JDBC URL. There is a special character(^) in the password which Neo4j does not like. Can someone help to handle this scenario? We have the following configuration in the Neo4j config file.

apoc.jdbc.redshift_sprint_url.url=jdbc:redshift://eds-xxx-redshift-etl-xx-xxx.xxx.us-east-1.redshift.amazonaws.com:5439/atlas?UID=redshift_user&PWD=A8xRnZ^dHrOO2gQ

and we are executing queries using this configuration as below.

CALL apoc.load.jdbc("redshift_sprint_url","select * from l2.weblog limit 2") YIELD row return row

now the problem is since the password has one special character(^) in it which Neo4j does not like and throws the following error.

Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure apoc.load.jdbc: Caused by: java.net.URISyntaxException: Illegal character in query at index

How to handle the special character in password?

Versions

lqst commented 4 years ago

Basically the connection string is passed to new URI in java. So any param need to be url encoded. Can you try to replace ^ with %5E?

lqst commented 4 years ago

Also, try putting user and pass in like this jdbc:redshift://redshift_user:A8xRnZ%5EdHrOO2gQ@eds-xxx-redshift-etl-xx-xxx.xxx.us-east-1.redshift.amazonaws.com:5439/atlas

sandipshinde commented 4 years ago

Thank you so much. After changing the connection string and adding URI encoded character in the password, the Redshift connection is working as expected. Thanks for your help. :)