cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC Connection String, Issue with the password

SOLVED
Highlighted
Occasional Contributor

JDBC Connection String, Issue with the password

Hello you all,

 

So I am trying to connect to my database using a JDBC teststep in SoapUI. I am using this connection string :

Capture.JPG

 

When I test this connection I get the error shown in this image :

Capture.JPG

 

After some researches, I found that the problem come from the '@' in the password (my password is '@12345').I changed the database password to '12345' and obviously it worked.

 

Is there any solution for me to connect to my database without changing the password ?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Contributor

Re: JDBC Connection String, Issue with the password

What operating system are you using? 

 

The script is fine, the only reason you are seeing is because soapUI cannot find the jar. 

Could you also put this jar in soapUI/lib  and restart.

 

 

View solution in original post

8 REPLIES 8
Highlighted
Frequent Contributor

Re: JDBC Connection String, Issue with the password

Hi,

 

You can pass your password in a string like below:

 

import groovy.sql.Sql 

sql = Sql.newInstance("jdbc: oracle:thin: @HOST:1521 : S I D " , "USER", "@12345", "oracle.jdbc.pool.OracleDataSource")

 

Please remove spaces from there, I had to put them in to avoid emojis haha

Highlighted
Occasional Contributor

Re: JDBC Connection String, Issue with the password

Hello,

 

Thank you for your response. I tried your code and I got this error :

Sans titre.png

Highlighted
Frequent Contributor

Re: JDBC Connection String, Issue with the password

Hi,

 

That's because you need an oracle jdbc7 or 8 jar depending on your windows version. 

 

Also, once that you have downloaded the jar from oracle website - you need to place it in SoapUI>bin>ext and restart soapUI and it should work

 

Goodluck

Highlighted
Occasional Contributor

Re: JDBC Connection String, Issue with the password

I already have the file ojdbc7.jar in SoapUI>bin>ex.

 

Do I have to import the driver in my groovy script ? Like : import java.sql.DriverManager; or something ?

 

Highlighted
Frequent Contributor

Re: JDBC Connection String, Issue with the password

No you should not need to. 

As long as you have the driver in ext folder, the above script should work as that's all you need for a connection.

 

 

Highlighted
Occasional Contributor

Re: JDBC Connection String, Issue with the password

ok but it still doesn't work... 😞

Highlighted
Frequent Contributor

Re: JDBC Connection String, Issue with the password

What operating system are you using? 

 

The script is fine, the only reason you are seeing is because soapUI cannot find the jar. 

Could you also put this jar in soapUI/lib  and restart.

 

 

View solution in original post

Highlighted
Occasional Contributor

Re: JDBC Connection String, Issue with the password

It works. Thank you for your help.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors