How to specify the oracle database url for Carbon data source creation? - datasource

The issue is that I am unable to connect to oracle database from the Carbon console while creating a datasource to a schema. The error is:
ERROR - DataServiceAdmin Could not connect to database jdbc:oracle:thin:#localhost:1522/ORADB12c with username WSO2_TUT
java.sql.SQLException: ORA-28040: No matching authentication protocol
I have a local installation of an Oracle database (12c). I would like to create a datasource on Carbon for a schema I have created on this database.
While providing the connection parameters I have selected to test the connection and the above error occurs.
I have added ojdbc6, then deleted and added ojdbc7 instead, then deleted and replaced with ojdbc14 to the directory of the WSO2 Enterprise Integrator:
D:\WSO2\EnterpriseIntegrator\6.5.0\lib
After that I restarted the server. When trying to re-create the datasource with the same credentials, I get this authentication error for some reason.
The connection details:
Datasource Id* oracle_DS
Datasource Type* RDBMS
Database Engine* Oracle
Driver Class* oracle.jdbc.driver.OracleDriver
URL* jdbc:oracle:thin:#localhost:1522/ORADB12c
User Name WSO2_TUT
Password ********
I don't know what's missing here, any help is greatly appreciated!
Thank you in advance
Regards,

Not sure if it helps, but here's the configuration that I use to connect to a oracle 11 database.
Datasource Type: RDBMS
Datas Sourec Provider: default
Driver: oracle.jdbc.driver.OracleDriver
URL: jdbc:oracle:thin:#hostname:1521:TNS_Listener
User name: myUser
Password: myPassword

Related

Access SQL DB Managed Identity in Data Factory using Key Vault

I'm trying to connect to Azure SQL DB using AD Authentication (Managed Identity) in Data Factory by saving the connection string in Azure Key Vault. I've setup the Managed Identity access in Azure SQL DB by providing the access to ADF (ADF name). I've stored the connection string in Key Vault in following formats but I was not successful.
Tried following formats of connection strings:
Server=tcp:xxxxxxxxxx.database.windows.net;Initial Catalog=xxxxxxx;Authentication = 'Active Directory Interactive';
Server=tcp:xxxxxxxxxxxx.database.windows.net;Initial Catalog=xxxxxxxxxxx;User ID=DatafactoryName;Authentication = 'Active Directory Interactive'; -- Actual DatafactoryName
Server=tcp:xxxxxxxxxxxxxx.windows.net;Initial Catalog=xxxxxxxxx;User ID=MSI_ID;Authentication = 'Active Directory Interactive'; -- Actual MSI ID for the DataFactory
Server=tcp:xxxxxxxxxxxxxx.windows.net;Initial Catalog=xxxxxxxxx;User ID=a;Authentication = 'Active Directory Interactive'; -- Tried arbitrary value
I'm getting the following error
The connection string should be:
Data Source=tcp:<servername>.database.windows.net,1433;Initial Catalog=<databasename>;Connection Timeout=30
The connection should like this:
Ref: Managed identities for Azure resources authentication and Reference secret stored in key vault
You can try
Integrated Security=False;Encrypt=True;Connection Timeout=30;Data Source=xxxxxxxxxx.database.windows.net;Initial Catalog=xxxxxxx

Using M code get data from SQL has credential error

I tried to connect data from SQL Server in my local using M code in Power Query. I can't see the difference between 2 codes, the first code connect and get data OK but the second code has error about credential. Pls tell me why it is
First code:
let
Source = Sql.Database("MyServer", "AdventureWorksDW2014"),
dbo_FactFinance = Source{[Schema="dbo",Item="FactFinance"]}[Data]
in
dbo_FactFinance
Second code:
let
Source = Sql.Databases("MyServer"),
AdventureWorksDW2014 = Source{[Name = "[AdventureWorksDW2014]"]}[Data],
dbo_FactFinance =
AdventureWorksDW2014{[Schema = "dbo", Item = "FactFinance"]}[Data],
in
dbo_FactFinance
The error of the second code:
thank you guys so much!!
Most likely your account has rights only for AdventureWorksDW2014 database.
In the first code snippet, you are connecting directly to AdventureWorksDW2014 database. In the second, you are connecting to the default database (usually this is master) and then the connection is switched to AdventureWorksDW2014 database. So if the login on the SQL Server for your account has only public server role, and has user mapping to AdventureWorksDW2014 (e.g. db_owner, db_datareader, etc.), then you must either use the first code, or to set the default database for your login to be AdventureWorksDW2014.
For more information take a look at Create a Login.

Can't connect Azure Table Storage to PowerBI (415) Unsupported Media Type)

I'm getting the error below while connecting to Azure Table Storage,
Details:
Blockquote "AzureTables: Request failed: The remote server returned an error:
(415) Unsupported Media Type. (None of the provided media types are
supported)
The one thing I noticed is that if I fill up only the account name it will automatically add the rest of the url which is ".table.core.windows.net" where in the portal its table.cosmosdb.azure.com.
With core.windows.net Im getting err "AzureTables: Request failed: The remote name could not be resolved". But it might messing up some headers while using table.cosmosdb.azure.com
Please advise.
Thank you.
m
You should be able to connect to your azure table storage/CosmosDB account using powerBi using the following link structure: https://STORAGEACCOUNTNAME.table.core.windows.net/ , or https://yourcosmosdbname.documents.azure.com:443/ for cosmosdb
You can get the correct link by going to Portal > go to Storage accounts > Click on Tables/CosmosDB > You'll find the table link you would like to link to powerbi > remove the last table name after "/", then use it to connect in powerbi, it will later allow you to select the specific table in powerBI:
These are screenshots from testing for CosmosDB:
Errors 415:
When it comes to these errors, they can be caused by cache, which can be flushed by going to:
In Power BI Desktop: Go to "File" and select "Options". Under "Data Load" you have the option to clear the cache. After doing this you can use "Get Data" and "OData-feed" as normal and the URL won't return the 415 error
Check the following link for additional suggestions:
Not clear how you consume the table service API, but here is the solution that worked for me for React SPA and fetch api.
Request header must contain:
"Content-Type":"application/json"
It was failing for me with single quotes, and worked with double.

NHibernate config connection string info

What's the best way to store connection string info?
I'd rather not just store the db password in NHib.config file.
Use encryption on the password and/or connection string and store the encrypted password/connection string in a config file of some sort. Then use my answer here to add the connection string value to the NHibernate Configuration object after decrypting it:
How to load application settings to NHibernate.Cfg.Configuration object?
Like:
nHibernateConfiguration.SetProperty(
NHibernate.Cfg.Environment.ConnectionString,
Util.Decrypt(encryptedConnectionString));
Generally you would put a password if you are connecting to say a sql server database with a sql login unless you decide to use windows authentication.
<connectionStrings><add name="MyDbConn1"
connectionString="Server=MyServer;Database=MyDb;Trusted_Connection=Yes;"/>
<add name="MyDbConn2"
connectionString="Initial Catalog=MyDb;Data Source=MyServer;Integrated Security=SSPI;"/>
</connectionStrings>
You should lock down the permissions/roles for what a sql server login can do.
If you have to use a sql server style login you could encrypt the password like this..
Encrypting Connection String in web.config
or some other links..
http://www.kodyaz.com/articles/Encrypting-in-web-configuration-file.aspx
http://www.codeproject.com/KB/cs/Configuration_File.aspx
http://www.velocityreviews.com/forums/t84120-how-to-encrypt-database-password-in-web-config-file.html
EDIT:
To use a connection string from a connectionstring element in the web.config file then this shows you..
http://www.martinwilley.com/net/code/nhibernate/appconfig.html
ALTERNATIVELY
use fluentnhibernate. :)

Login failed for user using SQL authentication

I have a connection made with a user name say ABC. In a method I create a new instance of sqlconnection named connection1 using the same connectionstring as that of the previous connection. When connection1.open() is issued it gives an exception stating that Login has failed for the user ABC. When SQL is able to connect to the user ABC for the first connection why does it fail for the second? I am using MARS=true in the connectionstring.
Thanks
What is the exact error please? And the code?
You could be connecting to a database where you have no rights, which gives a different error to a wrong password.