I am trying to connect to oracle database using os authentication through jdbc.
I have oracle 10g installed on solaris sparc 32 bit.
Following is the code for jdbc connection :-
String url = "jdbc:oracle:thin:#oracleserver.mydomain.com:5521:dbja"
Driver driver = new oracle.jdbc.OracleDriver();
DriverManager.registerDriver(driver);
Properties props = new Properties();
props.setProperty(OracleConnection.CONNECTION_PROPERTY_THIN_VSESSION_OSUSER,"oracle");
Connection conn = DriverManager.getConnection( url, props);
when i run the above code using thin driver, it gives error as "invalid username/password ; logon denied'
using oci driver error is :: "no ocijdbc11 in java.library.path" but i am using oracle 10g and in LD_LIBRARAY_PATH libocijdbc10.so is present. but still looking for libocijdbc11.so.
Please help me to resolve the issue.
Thanks
For using os authentication, please check the oracle documentation
How is the os_authent_prefix?
Does the user oracle exist?
Is REMOTE_OS_AUTHENT = TRUE?
For OCI access, the relevant thing here is the JDBC driver, which must match the oracle client version. To achieve this, add the 10g jdbc driver from your oracle client installation to the class path.
Related
I am using Corda Enterprise 3.1 and trying to move the vault from H2 to Oracle 12c using the Database Migration tool supplied. I have made the changes in the node.conf configuration using values I know work to connect from IntelliJ. The driver is Oracle's ojdbc8.jar that came with Oracle SQL Developer. The connection string is below but with some specifics masked. It doesn't work. Any ideas?
dataSourceClassName = oracle.jdbc.pool.OracleDataSource
dataSource.url = "jdbc:oracle:thin:#xxxxx.wellsfargo.com:1539:XXXXXX"
Here is the error I get:
-- 2018-08-07T00:04:55,757Z migration.tool.handleCommand - Exporting the current db migrations ... Failed to create datasource. Please
check that the correct JDBC driver is installed in one of the
following folders:
- /apps/team/drivers/jdbc
Caused By java.sql.SQLRecoverableException: IO Error: The Network Adapter could
not establish the connection
This issue was caused by an error in the host URL.
I'm currently upgrading a project from Java 7 to Java 8, thus I switched from using the JDBC-ODBC Bridge to using UCanAccess. The database I want to connect to is registered as a system DSN so I connected to it like this:
Database.forURL("jdbc:odbc:MyDB" + ";DB_CLOSE_DELAY=-1;charSet=Cp1250", driver = "sun.jdbc.odbc.JdbcOdbcDriver")
Now I changed that to
Database.forURL("jdbc:ucanaccess:MyDB" + ";DB_CLOSE_DELAY=-1;charSet=Cp1250", driver = "net.ucanaccess.jdbc.UcanaccessDriver")
but that gives me the error:
Driver net.ucanaccess.jdbc.UcanaccessDriver does not know how to handle URL jdbc:ucanaccess:MyDB;DB_CLOSE_DELAY=-1;charSet=Cp1250
Is there a way to access a DSN via UCanAccess?
Is there a way to access a DSN via UCanAccess?
Not directly. UCanAccess is a JDBC driver that does not use ODBC, so it has no knowledge of ODBC DSNs.
Your UCanAccess connection string needs to include the path to the Access database file, e.g.,
jdbc:ucanaccess://C:/path/to/mydata.accdb
If necessary, you could retrieve that file path from the configuration information for an ODBC DSN. On Windows, the information for a System DSN named MyDB would be in the Windows registry under
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\MyDb
or perhaps
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\MyDb
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.
I am using squirrel to connect to DB2 database.
I am able to successfully connect to one of our DB2 databases. But when I create a new connection to point to another db2 database, I get the below mentioned error.
java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc]...... Connection to the data server failed. The IBM Data Server for JDBC and SQLJ license was invalid
or was not activated for the DB2 for z/OS subsystem. If you are connecting directly to
the data server and using DB2 Connect Unlimited Edition for System z, perform the
activation step by running the activation program in the license activation kit.
If you are using any other edition of DB2 Connect, obtain the license file,
db2jcc_license_cisuz.jar, from the license activation kit, and follow the installation
directions to include the license file in the class path. ERRORCODE=-4230, SQLSTATE=42968
I also tried to create a new Driver to use in Squirrel, But that too doesnot work.
I have db2jcc_license_cisuz.jar available in the same folder where I pointed my driver jar.
I am really surprised why one connection to DB2 works and the other doesn't work.
db2jcc_license_cisuz.jar must be in CLASSPATH. Check db2jcc_license_cisuz.jar in Java Class Path or Extra Class Path in driver properties.
I am facing an error while connecting to database using unixODBC on IBM AIX 64bit
DB2 client V9.7 is installed on the machine.
Found on net that it can be due to library file:' libdb2o.so ' missing and in that case update to DB2 V9.7 Fix Pack3.
Updated DB2 client to DB2 V9.7 Fix Pack 4 but still no success.
On trying to connect to database using: isql -v it gives following error:
[01000][unixODBC][Driver Manager]Can't open lib '/opt/IBM/db2/V9.7_01/lib64/db2o.o' : file not found
[ISQL]ERROR: Could not SQLConnect
Details of .odbc.ini :
[db2_odbc_source]
Description = IBM DB2 ODBC data source
Driver = db2_odbc_driver
Trace = Yes
DMEnvAttr = SQL_ATTR_UNIXODBC_ENVATTR={DB2_CLI_DRIVER_INSTALL_PATH=/home/UserName}
Details of .odbcinst.ini :
[db2_odbc_driver]
Description = IBM DB2 ODBC driver
Driver = /opt/IBM/db2/V9.7_01/lib64/db2o.o
FileUsage = 1
DontDlClose = 1
Environment variables DBINSTANCE and ODBCINI are set.
Your help will be greatly appreciated.
Thanks.
libdb2o.o is used for connectivity via unixodbc for db2 database on 64 bit OS except nt64.on nt64,we use probably db2clio.o