cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC connections string with special chars

SOLVED
Highlighted
Occasional Contributor

JDBC connections string with special chars

I am migrating a project and trying to connect a datasource, the password for this system has a colon in it and I believe this is breaking the url, because a regular alpha password returns an invalid username/password whereas the correct password with the colon generates "invalid oracle url".

 

What is the documented way to fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Occasional Contributor

Re: JDBC connections tring with special chars

Yeah, I'm not really sure I agree with this. The URL scheme is one thing, I've worked with plenty of Oracle DBs with special chars and multiple systems easily allow connection via a url string that has special chars. For instance my PyCharm connects easily.

 

It seems the answer is that you need to double quote the password to escape the characters in the datasource manager , as in:

"mypassword:@"

rather than mypassword:@

 

Thanks

 

Jonathon

View solution in original post

3 REPLIES 3
Highlighted
Community Hero

Re: JDBC connections tring with special chars

Hey @jonathon,

Yep..... : just like @ and / are all reserved characters and have specific meanings in HTTP and should NEVER be used for user/schema and password whatever the RDBMS (Oracle, SQLServer, etc.) in a connection URL.

With the password like this, you cant use jdbc or jndi so this wont work for ANY tool trying to connect via jdbc or jndi including ReadyAPI!

This means this isnt a ReadyAPI! issue and even the error message gives you a clue. ReadyAPI! is just passing along the error response provided by your oracle db connection manager.

If you tell the DBA who's responsible for this database whats happening (i.e. an http reserved character has been used in the connection credentials) and he/she/they will immediately know what the problem is (and probably blame the DBA who set it 20 years ago) and change the password to something that doesnt include a reserved character!

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Occasional Contributor

Re: JDBC connections tring with special chars

Yeah, I'm not really sure I agree with this. The URL scheme is one thing, I've worked with plenty of Oracle DBs with special chars and multiple systems easily allow connection via a url string that has special chars. For instance my PyCharm connects easily.

 

It seems the answer is that you need to double quote the password to escape the characters in the datasource manager , as in:

"mypassword:@"

rather than mypassword:@

 

Thanks

 

Jonathon

View solution in original post

Highlighted
Community Hero

Re: JDBC connections tring with special chars

Sorry i should of been clear.
Special chars yes....ive tested plenty of apps with special alpha chars in username/password for a db..e.g. ,£^ etc., but NOT reserved HTTP chars.

This will never work with reserved http chars because...well...theyre reserved and have specific meanings in a URL which is why theyre reserved.

If you think back to your previous experience you wont be able to think of a connection string that used reserved http chars.

Nice one fella,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors