Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect To Database with jaydebeapi #231

Open
thuchet-u opened this issue Dec 16, 2024 · 2 comments
Open

Connect To Database with jaydebeapi #231

thuchet-u opened this issue Dec 16, 2024 · 2 comments

Comments

@thuchet-u
Copy link

Hi,

I'm trying to use the Connect To Database keyword instead of the deprecated ones, but it fails with the following error:
TypeError: connect() got an unexpected keyword argument 'database'.

JayDeBeApi is not in the list of supported Python modules. Is there a way to add support for it?

Environnement :
Python 3.10.8
Robot Framework 6.1.1
jaydebeapi 1.2.3

@amochin
Copy link
Collaborator

amochin commented Dec 16, 2024

Hi @thuchet-u, thanks for submitting the issue.
Could you please provide more details on it?
How exactly are you calling the keyword, with which parameters?

@thuchet-u
Copy link
Author

Hi @amochin

Jaydebeapi is waiting arguments like : jclassname, url, driver_args, jars, libs.
It works well with this deprecated keyword :

    DatabaseLibrary.Connect To Database Using Custom Params
    ...    jaydebeapi
    ...    'com.ibm.as400.access.AS400JDBCDriver','jdbc:as400://hostname',['USER','PASSWORD'],'.{/}jt400.jar'

So i tried with custom params :

    ${custom_params}    BuiltIn.Create Dictionary
    ...    jclassname=com.ibm.as400.access.AS400JDBCDriver
    ...    url=jdbc:as400://hostname
    ...    driver_args=[${DB_USER,${DB_PASS}]
    ...    jars=.${/}jt400.jar
    DatabaseLibrary.Connect To Database
    ...    jaydebeapi
    ...    ${custom_params}

And it fails with error : TypeError: connect() got an unexpected keyword argument 'database'
And these log message : Connect to DB using : jaydebeapi.connect(database='{'jclassname': 'com.ibm.as400.access.AS400JDBCDriver', 'url': 'jdbc:as400://hostname', 'driver_args': '[user,password]', 'jars': '.\\jt400.jar'}', user='')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants