cancel
Showing results for 
Search instead for 
Did you mean: 

Spacial Characters in JDBC STEP in password

SOLVED
Highlighted
Occasional Contributor

Spacial Characters in JDBC STEP in password

Not able to connect with SQL using JDBC step as the password contains the below special char:-
(
)
{
}

password Example:- INV-Q%+g@a>Az}q{R(axis?H6e#

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: Spacial Characters in JDBC STEP in password

Hi @nkdogra90

You say youre using jdbc connection string to connect to SQL DB, but all relational database management systems use SQL.
What is the vendor.....Oracle? MS SQL SERVER, IBM DB2? From what ive read trying to escape may differ between vendors. They all use ANSI standard SQL, but they all include propietary differences.

I couldnt see the embedded image at all to indicate what the error response was. Could you please paste in the error response message if you answer this message? Just remove the hostname details (no one will be able to hack without that) but include password when you post the error....i need to see the whole error text please if possible.

Ta

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

View solution in original post

12 REPLIES 12
Highlighted
Community Hero

Re: Spacial Characters in JDBC STEP in password

If the tool has limitation with special characters then either you want to change password with supported characters or open a ticket with customer care.

Mean while you may check with groovy script.


Regards,
Rao.
Highlighted
Occasional Contributor

Re: Spacial Characters in JDBC STEP in password

I have reported the same to customer care just checking if anyone can help me to solve the issue

Highlighted
Community Hero

Re: Spacial Characters in JDBC STEP in password

Hi @nkdogra90

What RDBMS are you trying to connect to? Sqlserver? Oracle? Etc.
I "think" they could use different escape chars depending on the db youre connecting to.

I know oracle uses \ to escape a special character and ive seen contradictory info around if your password includes reserved http and sql chars.

As Rao said....you can either change the password but you might be able to escape the special chars in the password.

So, you need to escape each special character by inserting a '\' before each instance of special char in your password.

If your password was 'pa((word' instead use 'pa\(\(word'

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: Spacial Characters in JDBC STEP in password

Its not working, I have already tried.

 

nkdogra90_0-1590765056240.png

 

Tags (1)
Highlighted
Occasional Contributor

Re: Spacial Characters in JDBC STEP in password

I am using SQL DB and trying to connect with the help of connection string from parameters.

Highlighted
Community Hero

Re: Spacial Characters in JDBC STEP in password

Hi @nkdogra90

You say youre using jdbc connection string to connect to SQL DB, but all relational database management systems use SQL.
What is the vendor.....Oracle? MS SQL SERVER, IBM DB2? From what ive read trying to escape may differ between vendors. They all use ANSI standard SQL, but they all include propietary differences.

I couldnt see the embedded image at all to indicate what the error response was. Could you please paste in the error response message if you answer this message? Just remove the hostname details (no one will be able to hack without that) but include password when you post the error....i need to see the whole error text please if possible.

Ta

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

View solution in original post

Highlighted
Occasional Contributor

Re: Spacial Characters in JDBC STEP in password

PFB the details:-

its a MS SQL SERVER 

Error details:-

com.eviware.soapui.support.SoapUIException: Failed to initialize the connection that uses the [com.microsoft.sqlserver.jdbc.SQLServerDriver] driver. Connection string:
[jdbc:sqlserver://HostName.net;databaseName=DatabaseName;user=UserName;password=OU-v%+G@a>Xb}qAQASb{R(ZaFO?H6e#-;].

 

Let me know if you have a solution .....It's yet to close.

 

 

Highlighted
Community Hero

Re: Spacial Characters in JDBC STEP in password

Hey @nkdogra90

Right, i spent about an hour trawling through various links (stackoverflow, github and ms online resources) and all the info ive found is contradictory. Some links state you can escape with \, others state to use a left curly brace, others suggested escaping can only be done with additional libraries added.

Firstly, did you try and escape all the special chars or just the brackets and curly braces? Cos youd need to escape all the relevant ones.

As im typing this, its just dawned on me. The connection string is a URL, right? Have you tried percent/html encoding the password?

I think either you get the password changed to remove the special chars (especially the sql and html special chars) OR, you try percent encoding your password string as youre passing the URL in an http request and http requests require percent/html encoding.

There are various online html encoders available.

After encoding your password of 'OU-v%+G@a>Xb}qAQASb{R(ZaFO?H6e#-;]'

Becomes 'OU-v%25%2BG%40a%3EXb%7DqAQASb%7BR%28ZaFO%3FH6e%23-%3B%5D'

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: Spacial Characters in JDBC STEP in password

I have tried everything which you had mentioned already and not able to mitigate the issue.
Its not a url thus encoded version is not working.
I want to escape all the special characters.
Tags (1)
New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
The new challenge is here!

Create a script to сhange an XPath Match assertion to a JSONPath Match assertion for the TechCorner tag!


Scripts created in July:
- A script to generate an email when an assertion fails
- A script to change the request body before sending it to the server
Top Kudoed Authors