Adding IBM Db2 as a datasource - db2

Has anyone had any luck or found documentation on how to add IBM Db2 as a datasource for their dashboard on Apache Superset? I don't see any information in the Db2 service credentials about the driver or dialect.

Based on the docs for Apache Superset the connections and hence the connection URI are based on SQLAlchemy. According to the Db2 driver for SQLAlchemy, the Db2 database URI would be like this:
db2+ibm_db://user:pass#host[:port]/database
db2+ibm_db is the dialect and driver, database is the database name on that host with the specified port (typically 50000). If you want to connect to a local database, just leave out the host/port combination:
db2+ibm_db://user:pass#/database

Related

Error to connect Postgresql DB from Oracle dblink using Oracle Database Gateway

I'm trying to connect from Oracle Database (dblink) to Postgresql database use Oracle Database Gateway (dg4msql 19), on the Oracle Database Gateway for MS SQL Server all work fine. On the Oracle DB create dblink, but when try to connect get Error message:
ORA-28500 Oracle ODBC SQL Server Wire Protocol driver Socket closed
08S01 Oracle ODBC SQL Server Wire protocol driver
The server does not support SSL {HY000} !
listener work, tnsnames.ora also give correct answer. May be in initdg4msql.ora file I have to use some string to connect without SSL?
HS_FDS_CONNECT_INFO = postgre_servet.net:5432//database - I don`t known that is correct for PostgreSQL, or for PostgreSQL should use only ODBC connection?
How correctly use HS_FDS_CONNECT_INFO = postgre_servet.net:5432//database, or for PostgreSQL should I use only ODBC connection?
The PostgreSQL server is not configured to accept SSL connections.
First, verify that PostgreSQL was built with SSL support: that can be seen from the output of pg_config --configure (should contain --with-openssl).
To configure SSL support, set ssl = on in postgresql.conf and provide a server certificate and private key (parameters ssl_vert_file and ssl_key_file). Reload PostgreSQL to activate.
For details, read the documentation.

DNS ODBC Driver configuration for SSH RDS

I´d like to know if it is possible to connect to my rds database from my local machine (windows) using windows odbc data source. My problem is that I use SSH and i don´t know how can I input the parameters in odbc data source. I need this type of connection because I want to access RDS via vba excel. My database is Postgresql.
If you have a publicly accessible database (not recommended by AWS) and your IP address is allowed, then the normal ODBC connection will work.
By the sound of your setup, you have a private database. In which case, your options are:
Use a different ODBC driver that supports tunnelling.
Devart (https://www.devart.com/odbc/postgresql/) and Cdata (https://cdn.cdata.com/help/FPG/odbc/RSBPostgresql_c_SSH.htm) both have ODBC drivers that support SSH tunnelling.
Neither are free.
Use a VPN and point your driver at localhost

Informatica DB2 DSN not working in Designer

I am trying to connect to DB2 database to import source structure. I tried using ODBC DB2 Wire Protocol Driver Setup. I provided IP Address, TCP Port, Location ( DB2 to Z/OS and Iseries), but when I click on test connection I get below error:
[Informatica][ODBC DB2 Wire Protocol driver][DB2]NULLID.DDOS510A DOES NOT HAVE PRIVILEGE TO PERFORM OPERATION PACKAGE ON THIS OBJECT.
Same method I tried in lower environment of DB2 and connection works. but in higher environment I get this error. ( I verified login in the database directly and my user id has login access).
This is not a programming question, it is about configuration.
The reason that it works on one database, but fails on another, is because only one of the databases has the correct permissions.
Ask the DBA to grant relevant privileges to the userid at the database.
You will find more details at the following IBM technote and also at here.

Connection between spark and tableau on tableau desktop

I am trying to connect the spark to tableau, I had installed Simba ODBC driver for 64bit, but I am facing issues while connrecting to spark.
ERROR:
Unable to connect to the ODBC Data Source. Check that the necessary drivers are installed and that the connection properties are valid.
[Simba][ODBC] (10000) General error: Unexpected exception has been caught.
In some doc, I saw that tableau requires some special license key. Can you please explain it
Basically spark works with the hive but with difference engine(algorithm for fetching data)
so initially to connect spark from tableau we need to install ODBC Hive drivers then spark driver.
Hive Driver:
http://www.tableau.com/support/drivers
Spark driver :
https://databricks.com/spark/odbc-driver-download
while installing spark on your cluster we need to configure thrift server with the hive server and need to give new port address.
you can go through using link to install spark in ambari :
http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.4/bk_spark-guide/content/ch_installing-spark.html
And the respective port address need to be specified in tableau while connecting.
If your Cluster is secured with user name and password we need to specify the Authentication as "USERNAME AND PASSWORD" and need to give credentials there..
Even though if it raises error, then look into below areas:
An incorrect port and/or service defined in the connection
Web Proxy or Firewall settings are blocking connection from Tableau Desktop
The data server is not started.

DB2 ODBC Connection String without Database Name

I am trying to connect DB2 Server with ODBC, which is working fine if I specify Database in connection string.
driver = 'IBM DB2 ODBC DRIVER'
server = '10.30.30.114'
port = '50000'
protocol = 'TCPIP'
database = 'SAMPLE'
user = 'administrator'
pass = 'password'
DBI.connect("DBI:ODBC:Driver=#{driver};HostName=#{server};Port=#{port};Protocol=#{protocol};Database=#{database};Uid=#{user};Pwd=#{pass};")
The issue is I will not be knowing the database name in advance at the time of connecting to the server. I want the list of databases on the server and then tables in those databases, how should I approach?
You cannot "connect to a DB2 server" via ODBC; you can only connect to a database, for which you obviously need to specify the database name. You could use the DB2 C/C++ API calls db2DbDirOpenScan and db2DbDirGetNextEntry to list the database directory, but this code will need to be executed on the server itself, otherwise it will attempt to list the database catalog on the client machine.
IF you are connecting to DB2 for i server (formerly DB2 UDB on OS/400) --
Initially connect using hostname, allowing database to default. You can then get a list of databases in the DB2 for i SYSCATALOGS view. Your query might look like this:
SELECT catalog_name, -- database name
catalog_text -- DB description
FROM QSYS2.SYSCATALOGS
WHERE catalog_type='LOCAL' -- local to that host
AND catalog_status='AVAILABLE' -- REMOTE catalogs are 'UNKNOWN' status
You could then connect to that database if . Once connected to the appropriate database, you could query other DB2 for i catalog views such as SYSSCHEMAS and SYSTABLES. ODBC/JDBC Catalog views and ANS/ISO Catalog views would also be available.
Other API's are available outside of an ODBC connection via IBM i Access, if you prefer.