Connect NiFi to Oracle 11g - oracle

I have no problem to connect Oracle 11g with Oracle SQL Developer with configuration below:
Username: orc
Password: PAP
Connection Type: Basic
Hostname: connect.gogo.com
Port: 1528
Service name: svcname
In NIFI, any idea how should I put the value for the Database Connection URL?
Database Connection URL:
Database Driver Class Name: oracle.jdbc.driver.OracleDriver
Database Driver Location: /opt/nifi/jdbc/ojdbc8.jar
Thanks,
Kenny

you can add a DBCPConnectionPool under Controller Service like this

Database Connection URL: jdbc:oracle:thin:#connect.gogo.com:1528/svcname
more information here
https://docs.oracle.com/cd/E11882_01/appdev.112/e13995/oracle/jdbc/OracleDriver.html
or you could use tnsnames.ora file syntax in url like this:
Database Connection URL: jdbc:oracle:thin:#(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL=TCP)(HOST=connect.gogo.com)(PORT=1528)))(CONNECT_DATA=...))

Related

Oracle database connection via Codeingniter 4

Hi I have a Oracle database installed locally on my laptop. I'd like to connect to it via Codeigniter 4. Since version 4.2.0 it is able to do so.
https://codeigniter4.github.io/CodeIgniter4/changelogs/v4.2.0.html
All my database credentials are in the .env file, but I'm unable to establish connection. I'm new to Oracle.
I can connect to my database via Oracle SQL Developer.
The data I use for the connection:
host: localhost
port: 1521
user: system
password: MYPASSWORD
service name: orcl
How can I use that in my .env file?
This is what I have so far:
database.default.hostname = localhost
database.default.database =
database.default.username = system
database.default.password = MYPASSWORD
database.default.DBDriver = oci8
database.default.DBPrefix =
database.default.port = 1521
I get this error:
Unable to connect to the database.
Main connection [oci8]: oci_connect(): ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
(.env file)
Try using:
database.default.hostname = '127.0.0.1:1521/orcl'
Where:
'127.0.0.1:1521/orcl', // hostname:db_port/service_name

Issue implementing Sql_tracker_store

I want to use sql tracker store to store the conversation history in db but it seems it is not working for me.
I am having MySQL database which i want to connect for that i am using below code in my endpoint.yml
tracker_store:
type: SQL
dialect: "sqlite" # the dialect used to interact with the db
url: "localhost" # (optional) host of the sql db
db: "chatbot" # path to your db
username: "root" # username used for authentication
password: "test" # password used for authentication
when i am running rasa shell -m models --endpoints endpoints.yml
i am getting below error.
" sqlite:////absolute/path/to/file.db" % (url,)
sqlalchemy.exc.ArgumentError: Invalid SQLite URL: sqlite://root:test#localhost/c
hatbot
Valid SQLite URL forms are:
sqlite:///:memory: (or, sqlite://)
sqlite:///relative/path/to/file.db
sqlite:////absolute/path/to/file.db
When i tried to connect the same db using python code it worked for me. Below is my python code.
import mysql.connector
mydb = mysql.connector.connect(host="localhost",port="3306",user="root",database="chatbot",password="test")
mycursor = mydb.cursor()
sql = "Show tables;"
mycursor.execute(sql)
myresult = mycursor.fetchall()
print(myresult)
for x in myresult:
print(x)
Please help me how can i resolve this.
You need to change the dialect to use MySQL and db to include the .db suffix in your endpoint.yml:
tracker_store:
type: SQL
dialect: "mysql" # the dialect used to interact with the db
url: somewhere
db: "chatbot.db"
username: "root"
password: "test"
More info in the SQLALchemy docs 😊
You need to install pymysql using pip.
tracker_store:
type: SQL
dialect: "mysql+pymysql"
url: "localhost"
db: "Rasabot"
username: "root"
password: "xyz"

Connection in Oracle Sql Developer

I am trying to create a new connection in Oracle SQL Developer. Below are the inputs:
Connection Name:Dbms
Username:[My Name]
Password:[Ubuntu Password]
ConnectionType:Basic
Role: default
Hostname: localhost
Port: 1521
SID: xe
Upon clicking Test an error is being displayed:
Network Adapter could not establish connection

How to configure SSL mongodb connection in YML file spring boot?

I was trying to setup a ssl mongodb connection from spring boot but I couldn't able to find a way to set a connection from YML file(beacuse it's easy to maintain dev and prod environment). How can I add client.PEM and rootCA.pem keys to below connection?
Please note this not a database administration question!
data:
mongodb:
authentication-database: admin
database: <database>
host: <host>
password: <password>
port: <port>
username: <username>
One way to resolve it is simple use URI string connect and database name in your application.yml file. Example:
data:
mongodb:
database: &ltdatabaseName&gt
uri: &ltmongodb://[username:password#]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]&gt
Example with SSL option:
mongodb://user:password#mongoServer:27017/?ssl=true
More info here https://docs.mongodb.com/manual/reference/connection-string/

Can't Connect ClickHouse With JDBC Driver Using DBeaver

I want to connect clickhouse with jdbc driver using DBeaver. My driver settings are:
Driver Name: clickhouse
Class Name: ru.yandex.clickhouse.ClickHouseDriver
URL Template: jdbc:clickhouse://{host}:{port}
When I test the connection, it throws me an exception like this:
ru.yandex.clickhouse.except.ClickHouseUnknownException: ClickHouse exception, code: 1002, host: xxx, port: 8123; error while read response Magic is not correct: 112
Where I'm wrong?
My DBeaver version was old, I updated my version and its solved.

Resources