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

How to connect DB2 Database using JDBC driver #148

Open
centhil opened this issue Oct 20, 2021 · 1 comment
Open

How to connect DB2 Database using JDBC driver #148

centhil opened this issue Oct 20, 2021 · 1 comment
Labels

Comments

@centhil
Copy link

centhil commented Oct 20, 2021

*** Settings ***
Suite Setup Connect To Database ibm_db_dbi ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort}
Suite Teardown Disconnect From Database
Resource Config.txt
Library DatabaseLibrary

*** Test Cases ***
Table Must Exist - person
Table Must Exist P01.TCCDE

But getting error

Parent suite setup failed:
ProgrammingError: ibm_db_dbi::ProgrammingError: [IBM][CLI Driver] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968\r SQLCODE=-1598

@blamaire
Copy link

I am using the following keyword for connecting to DB2:

Connect To Database Using Custom Params    jaydebeapi    jclassname='com.ibm.db2.jcc.DB2Driver', url='${jbdc url}', jars='${db2jars}', driver_args='${credentials}'

Where the variables take the following form:

${jdbc url}    jdbc:db2://<url>:<port>/<database>
${db2jars folder}    <db2 jars folder path>
@{db2jars}    ${db2jars folder}/db2jcc4.jar    ${db2jars folder}/db2jcc_license-cisuz.jar    ${db2jars folder}/db2jcc_license_cu.jar
@{credentials}    <username>    <password>

The jar files with the name licence.jar should take care of the license problem.

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

No branches or pull requests

3 participants