Connect to Oracle using ADO - oracle

I'm trying to connect to an Oracle Server using ADO and Oracle Wallet,
First of all, my wallet IS working. I have tested it using
SQLPLUS /#DDKTEST
If I provide username and password in my connection string it works fine:
Provider=MSDAORA;Password=<my password>;User ID=<My user ID>;Data Source=DDKTEST;Persist Security Info=True
But I'm stoked when I need to make a Connection String for Oracle Waller
I've tried the following:
Provider=MSDAORA;Data Source=DDKTEST;Persist Security Info=True
But it doesn't work.
So in short: I need a connection string for ADO, in order for connection to Oracle using my Wallet.

The connection string that we are using with wallets is:
Provider=OraOLEDB.Oracle;Data Source=TNSName;OSAuthent=1;
We use this successfully with TADOConnection in Delphi (first XE5, now 10).
Where TNSName is an alias as defined in TNSNames.ora. I must note that we use a different provider (reflected in the provider name, OraOLEDB.Oracle), and I don't know if this will also work with the outdated and deprecated MSDAORA.
We did use MSDAORA before, but switched to OraOLEDB before we started using the wallets. I do remember that it was quite primitive and didn't even support BLOBs, so I'm not very confident it will support wallets at all.

Related

How to get Oracle DB connection string

I need to connect my Microsoft Report Builder to Oracle DB but I could not seem to find the correct connection string for Oracle.
I tried:
Specifying username and password
Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;Integrated Security=no;
but it returned:
Is it saying that I need to download the Oracle driver? Or should I get the connection string for Oracle DB?
If you don't already have it, you will need the Oracle Client installed. It will include an ODBC driver. ODBC is a wrapper for the Oracle Client, not a replacement. When setting up your connection you will also need to get the connection properties from the DBA (e.g. hostname/ip address, port, service name, username and password).
See documentation here:
https://docs.oracle.com/en/database/oracle/oracle-database/19/adfns/odbc-driver.html
https://www.oracle.com/database/technologies/releasenote-odbc-ic.html

Export Database connection to Oracle Developer

I have a database Connection established in odbcad and Microsoft Access (aswell as working in Excel) via ODBC and want to also get it working in Oracle SQL developer.
It is a Windows SQL Server as far as i know and I have tried several Settings, of which None works. I have also installed Driver for ODBC. I would like to Import Settings into SQL developer as applied in MS Access, is there any possibility?
No, SQL Developer is a Java application and uses a JDBC driver.
But if you look at the odbc properties for your connection, those should largely translate to what you need to define a basic connection.
Oracle:
Server name or IP address of the DB, port # for the listener, and the name of the SID or Service, plus a valid username and password is all you need to connect to Oracle.
What error do you get when you try to connect?
Show us what you're trying.
Update:
You're trying to connect to SQL Server but you're getting"
Native SSPI library not loaded
You're trying to use OS Authentication for your connection. For this to work with the jTDS driver, you need to copy a DLL file named ntlmauth.dll (which is for NT authentication) under the jtds-x.x.x-dist\x86\SSO\ or jtds-x.x.x-dist\x64\SSO\, to any directories in the PATH environment.
Please update your question such that's it's clear you're connecting to SQL Server and share the error message so others can find it.
I imagine this question is a duplicate of many previous iterations of the same challenge.

How to connect sql developer to Oracle database using instant client_12_1

I have downloaded the oracle instant client 12_1 but i'm unable to connect to the oracle database.when i tried using sql developer it is displaying the following error.
The Network could not be established.
I'm using windows 7 and my Oracle_home path is defautly set in the system variables as
path
E:\app\dell\product\11.2.0\dbhome\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
I suspect you've begun the headache of messing with the connection string. I seriously recommend you find the option in SQL Developer that will allow you to connect directly to the server (bypass TNSNAMES) and use EZ Connect. The connection string will look like this:
server.whatevz.com:port/sidname
I don't use SQL Developer, so I can't point to it specifically, but I have used it and configured it as such, and it works fine. I'm a fan of PL/SQL Developer (All Around Automation) myself.

How do I connect to Oracle with SSIS? I am getting the error: "tns listener was not given the service_name in connect_data"

I am trying to connect to an Oracle DB through the Oracle Provider for OLE DB in SSIS, but am getting the following error when testing the connection: "tns listener was not given the service_name in connect_data". I am not too familiar with Oracle, so could someone provide me some direction for how to fix this error?
You can add the service name after the host name with a forward slash between them. This has worked in both the Microsoft and Oracle OLE DB providers.
IP/Service_Name also works, "12.12.123.123/Server1.domain.com"
First of all, always use Oracle driver. Not the Microsoft one.
Then, when connecting, supply the TNSNAME, USERNAME and PASSWORD to a OLEDB Connection.
That's all!
Ok ok, been here, and this is what works:
You need oracle data access components http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html
Download the one that applies to you (11g, 12c...)
It installs an OLE DB provider which is FAST and also .NET connectors (wich also work really well), so I recommend using OLEDB (also, attunity connector works wonders aswell after you installed ODAC).
Then just connect using ip/service name + credentials, for example
Image
You need to type "Servername/ServiceName" to Server Name Field .

How to use "basic" as connection type?

I'm able to use Oracle SQLDeveloper to make a connection to an Oracle database. I'm using "basic" as connection type and I can access database successfully. The problem is that basic authentication is the only way to access that database at the moment (there is some misconfigururation but this is another problem and can not be solved by myself).
To work around this I want to use basic authentication with JDBC. Is this possible? Can someone give me an example? I found only examples with thin or oci configuration. Both are not working for me.
Thank you very much!
From the help in SQL Developer:
Advanced connection type
Custom JDBC URL: URL for connecting directly from Java to the
database; overrides any other connection type specification. If you
are using TNS or a naming service with the OCI driver, you must
specify this information: Example:
jdbc:oracle:thin:scott/#localhost:1521:orcl
Note that in this example, the "/" is required, and the user will be
prompted to enter the password. I actually wasn't prompted for p/s see notes below
To use a custom JDBC URL, the system on which SQL Developer is running
must have an Oracle Client installation that contains the JDBC and
orai18n libraries, is present on the path, and is version 10.2 or
later.
So all you need to do is select the "Advanced" connection Type, then input the below line (changed to your settings)
jdbc:oracle:thin:USER/#HOST:PORT:SID
but it will also work (and use the Username/Password already inputted) if you omit the "User/" as such
jdbc:oracle:thin:#HOST:PORT:SID
It seems to use the password that is already in the "Password" box in the Database Connection.
If this does not work for you, post how it does not work. I tried the connections from "Basic", TNSNames, and Advanced (using the THIN client) without incident- take note of the using a custom JDBC URL, but I would have to ask why if that is the intent?
hth
There was no mistake in configuration. But there was a problem with the cluster (cluster switched to the other node). I can't understand this behaviour and I can't reproduce it anymore, but it's working again now. Thanks for your help!

Resources