Forum Discussion
Hey chikki78
I'm sorry - I'm not clear what the problem is - are you saying the connection string you want isn't in the listing?
I can see a connection option in yoru attached screenshot - but I don't know what it's supposed to represent.
also in the screenshot the host is set as your local loopback ip address. Surely the DB2 instance isn't local to your machine where you're running ReadyAPI!?
Cheers
richie
Hi Richie,
in DB2 we have schema option available right.where i need to provide those details.
In Groovy we can provide by below example. my question is how to provide the schema option.I tried to set it in properties but it did not helped me.
Example in groovy:
sql = Sql.newInstance('jdbc:db2://10.x.x.x:50000/dbname:currentSchema=MY_QA;','dbuser', 'dbpwd','com.ibm.db2.jcc.DB2Driver');
where i need to priovide the below part
"currentSchema=MY_QA"
- richie6 years agoCommunity Hero
Hey chikki78
Question: there are currently 2 DB2 connection string options already configured - have you tried both and specified your 'currentSchema:My_QA' and 'My_QA' value as the DB value?
so that when you select the configure button on the JDBC step - the following image launches - have you tried inserting the 'currentSchema:MY_QA' or 'My_QA' value into the 'Database' field?
If the above doesn't work then you need to configure your connection string accordingly - but you're almost there.
if you need to tailor the connection string beyond what the default is configured for within ReadyAPI! - you can just add a new option in there.
i.e.File >> Preferences >> JDBC
There you see a form window displaying a table - 1 column is entitled 'Driver', 1 column is entitled 'Connection String Template'
Click on the green plus button to add a new row in
add in the driver name (this actually can be anything) but I'd go with
schema/com.ibm.db2.jcc.DB2Driver
then I'd add in the Connection string template
jdbc:db2://<HOST:127.0.0.1>:<PORT:50000>/<DB>:user=<USER:db2admin>;password=<PASSWORD:db2admin>;currentSchema=<MY_QA>;
OR
jdbc:db2://<HOST:127.0.0.1>:<PORT:50000>/currentSchema=<MY_QA>:user=<USER:db2admin>;password=<PASSWORD:db2admin>;
OR
jdbc:db2://<HOST:127.0.0.1>:<PORT:50000>/<DB>:currentSchema=<my_QA>:user=<USER:db2admin>;password=<PASSWORD:db2admin>;
Every different RBDMS has a different definition of what it perceives as the 'schema' - and I can't remember much (I'm more Oracle and SQLServer) but DB2 is way more complicated, but currently in your groovy connection string you are specifying currentSchema:My_QA as the dbname. The above 3 connection strings or variations on those should get you there.
You might have to tailor the connection string a little - but something like the above should give you what you need.
At this point, go into the SoapUI tab, edit your JDBC step and click on the 'Configure' button - select the new connection option and populate the fields with the relevant values and test the connection.
Sometimes it's a little fiddly setting the connection string to the parameters you need - the extra parameters are supposed to be 'optional' (like currentSchema, etc.) but it depends on your implementation.
You can definitely connect from SoapUI using yoru current setup (proved because you can connect via groovy) - so it's just a case of setting the connection string in the preferences correctly and populating the fields correctly
Cheers,
richie
Related Content
- 2 years ago
- 6 years ago
- 5 years ago
Recent Discussions
- 23 hours ago
- 17 days ago