Hello,
I am trying to connect to multiple databases with DatabaseLibrary but its not working.

*** Settings ***
Library           DatabaseLibrary    WITH NAME    db1
Library           DatabaseLibrary    WITH NAME    db2

*** Keywords ***
connect db1 database
    db1.Connect To Database Using Custom Params    cx_Oracle    'db1 connection string'
    @{queryResults1}=    db1.Query    select * from db1_table  --> OK
    db2.Connect To Database Using Custom Params    cx_Oracle    'db2 connection string'
    @{queryResults1}=    db2.Query    select * from db2_table  --> also OK
    @{queryResults1}=    db1.Query    select * from d1table  --> fails saying that db1_table does not exist

==============================
You did not specify which DatabaseLibrary you are talking about, but they both appear to have the same design flaw.

They both have a test library scope of GLOBAL.

RF will not create another instance of a library that is scoped GLOBAL. From the user guide, this appears to be by design.
In other words both db1 and db2 reference the same instance of DatabaseLibrary.
To fix, do all your queries in db1, then disconnect and connect to db2 and do all your queries there, etc.
If you want to do queries in both databases without (dis)connecting, there is a fairly easy way with the Python version.
 
Create a custom library as below:
----start content of DatabaseLibrarySS.py----
from DatabaseLibrary import DatabaseLibrary
 
class DatabaseLibrarySS(DatabaseLibrary):
    ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
----end content of DatabaseLibrarySS.py----
 
*** Settings ***
Library           DatabaseLibrarySS.py    WITH NAME    db1
Library           DatabaseLibrarySS.py    WITH NAME    db2
 
*** Test Cases ***
Multiple Instances of DatabaseLibrary
    ${db1}=    Get Library Instance    db1
    ${db2}=    Get Library Instance    db2
    Should Not Be Equal    ${db1}    ${db2}
 
A library with a scope of GLOBAL should implement keywords to make concurrent use from different contexts possible. For examples, see Switch Process in OperatingSystem or Switch Browser in Selenium2Library.
what am i doing wrong here?

Thanks in advance for your time and help.

RF:connecting to multiple databases的更多相关文章

  1. RF:RF实现根据乳腺肿瘤特征向量高精度(better)预测肿瘤的是恶性还是良性—Jason niu

    %RF:RF实现根据乳腺肿瘤特征向量高精度(better)预测肿瘤的是恶性还是良性 load data.mat a = randperm(569); Train = data(a(1:500),:); ...

  2. 乌龙之MySQL slave IO status:connecting

    搭建了一个主从,状态一直如下: 检查错误日志报错如下: review搭建过程,语法并没有问题. 检查用户及网络,也没有问题: so?what is the cause ? 等等....貌似上面搭建用的 ...

  3. Django RF:学习笔记(8)——快速开始

    Django RF:学习笔记(8)——快速开始 安装配置 1.使用Pip安装Django REST Framework: pip install djangorestframework 2.在Sett ...

  4. 数字图像处理实验(10):PROJECT 05-01 [Multiple Uses],Noise Generators 标签: 图像处理MATLAB 2017-05-26 23:36

    实验要求: Objective: To know how to generate noise images with different probability density functions ( ...

  5. mysql:[Err] 1068 - Multiple primary key defined

    添加主键时,出现错误:[Err] 1068 - Multiple primary key defined #增加主键 ) not null; ; alter table my_test add pri ...

  6. 项目警告:There are multiple modules with names that only differ in casing.This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.Use equal casing. Compare these modul

    记录个自己遇到的问题: 上星期项目刚拉取下来的时候运行没有任何警告,晚上回去vscode提示更新新的东西,当时没管就立即更新了,第二天重启项目直接一大堆警告冒了出来: There are multip ...

  7. 【九度OJ】题目1439:Least Common Multiple 解题报告

    [九度OJ]题目1439:Least Common Multiple 解题报告 标签(空格分隔): 九度OJ 原题地址:http://ac.jobdu.com/problem.php?pid=1439 ...

  8. 题目1439:Least Common Multiple(求m个正数的最小公倍数lcm)

    题目链接:http://ac.jobdu.com/problem.php?pid=1439 详解链接:https://github.com/zpfbuaa/JobduInCPlusPlus 参考代码: ...

  9. POJ 1426:Find The Multiple

    Find The Multiple Time Limit: 1000MS   Memory Limit: 10000KB   64bit IO Format: %I64d & %I64u Su ...

随机推荐

  1. java 获取(格式化)日期格式

    // 参考: https://www.cnblogs.com/blog5277/p/6407463.htmlpublic class DateTest { // 支持时分秒 private stati ...

  2. u盘装完centos系统恢复

    1.使用windows的cmd窗口,执行diskpart命令 2.执行 list disk命令,查看u盘 3.执行 select disk 2,选中u盘,注意,这里的2是我自己的显示,千万不要选错 4 ...

  3. 解决modelsim破解在win10下无法生成license

    显示没有找到mgls.dll,此时,这个教程能够帮助你. 1.右击搜索结果cmd,选择以管理员身份运行 2. 打开win64(进入安装目录的win64),也就是两个破解文件所在的路径,输入cd win ...

  4. CF6

    A A 不解释 #include<bits/stdc++.h> using namespace std; namespace red{ inline int read() { int x= ...

  5. 「POI2015」KIN

    传送门 Luogu 解题思路 想要做这道题,只要会维护区间最大子段和就好了. 而这个可以用线段树维护模板点这里 对于重复的情况,我们可以对每一个位置记一个前驱表示和当前位置种类相同的前一个位置. 然后 ...

  6. Java 推荐读物与源代码阅读

    Java 推荐读物与源代码阅读                                                     江苏无锡  缪小东 1. Java语言基础     谈到Java ...

  7. instance与可变参数合用,多态性

    public class Doubt { public static void main(String[] args) { Dog d1=new Dog(); Dog d2=new Zangao(); ...

  8. SciPy 基础功能

    章节 SciPy 介绍 SciPy 安装 SciPy 基础功能 SciPy 特殊函数 SciPy k均值聚类 SciPy 常量 SciPy fftpack(傅里叶变换) SciPy 积分 SciPy ...

  9. NO19 优化Linux系统--重要开机自启动服务--关闭自启动项

    **如何优化Linux系统: 1   不用root,添加普通用户,通过sudo授权管理.2   更改默认的远程连接SSH服务端口及禁止root用户远程连接.3   定时自动更新服务器时间.4   配置 ...

  10. spring事物(一),@EnableTransactionManagement @Transactional 启动解析

    1.事物的声明阶段 @EnableTransactionManagement,是我们开启注解事物的第一步,我们来看下这个类为我们干了什么 @Target(ElementType.TYPE) @Rete ...