Issue on Database Connectivity via Python Database Library and cx_Oracle api drivers

570 views
Skip to first unread message

sreeja ramachandran

unread,
May 31, 2017, 9:53:36 AM5/31/17
to robotframework-users, suryaraja...@gmail.com
Hi Buddies

Kindly help me out to perform the database connectivity via Python Database Library .

Inputs on Environment :
python version : 2.7.8
database library version : 1.0.1
A Database API Specification 2.0 Python Module : DB API 2.0 Drivers -cx_Oracle
Oracle client version : 11.2
Robot framework version : robotframework-3.0.2-py2.7.egg-info

EXECUTION : pybot -L TRACE database_sample.txt

ISSUE :

database_sample.txt
*** Test Cases ***
Sample program
   Database Library.Connect To Database  cx_Oracle    dbname   username    pwd   hostname    port
 // 'dbname'   'username'    'pwd'  ' hostname'    'port' are given the corresponding values as per the environment
LOG Level :

FAIL : TypeError: 'database' is an invalid keyword argument for this function
DEBUG : Traceback (most recent call last): File "C:\Python27\lib\site-packages\DatabaseLibrary\connection_manager.py", line 100, in connect_to_database self._dbconnection = db_api_2.connect(database=dbName, user=dbUsername, password=dbPassword, host=dbHost, port=dbPort)

Please refer to attached screenshot for detailed log

NOTE : we could perform database connection using 'databse library - java ' but we are in need to work with python. Hence we arrived with mentioned issue.

Thanking you !

Regards
Sreeja
connect to database.jpg

Jerry Schneider

unread,
May 31, 2017, 10:59:46 AM5/31/17
to robotframe...@googlegroups.com
Can you try using the Custom connect keyword
Can you try using the Custom connect keyword?  Something like:

Connect to Database Using Custom Params    cx_Oracle    username@hostname:portNo/dbName

I do not have an Oracle db to connect to unfortunately.  A quick review of cx_Oracle connection does not show it supporting the standard db api 2.0 connection strings.  The Custom connection should work for you though.

Jerry S
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

-- 
http://www.linkedin.com/in/jerryschneider
Linux registered user #475536
Ubuntu registered user #28583

sreeja ramachandran

unread,
Jun 1, 2017, 12:57:38 AM6/1/17
to robotframework-users, jer...@gmail.com
Yeah it works. Thank you:)

-Sreeja
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.

To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages