简体   繁体   中英

Oracle SQL Developer - Issue with JDBC Driver

I've:

  • Windows 7 x64
  • My 11G Oracle client as per below C:\\Oracle\\product\\11.2.0\\client_1
  • My SQL Developer (downloaded the kit with JDK 8 included, but installed the JSK separately just in case) dir as per below C:\\sqldeveloper

When I try to connect using TNS I have

no ocijdbc12 in java.library.path

If I go to Settings -> Database -> Advanced and choose my Oracle dir manually I get this:

Testing the Oracle Home located at C:\\Oracle\\product\\11.2.0\\client_1 Testing client directory ... OK Testing loading Oracle JDBC driver ... OK Testing checking Oracle JDBC driver version ... Failed: Minimum driver version 11.2.0.3 required, specified driver version is 11.2.0.1.0

So I looked into upgrading the JDBC driver, but I can't use the check for updates feature, since it appears to be blocked in my virtual machine.

I got the ojdbc7.jar from the SQL developer directory and copied it to C:\\Oracle\\product\\11.2.0\\client_1\\jdbc\\lib, and now I get the error below:

Testing the Oracle Home located at C:\\Oracle\\product\\11.2.0\\client_1 Testing client directory ... OK Testing loading Oracle JDBC driver ... OK Testing checking Oracle JDBC driver version ... OK Driver version: 12.1.0.2.0 Testing testing native OCI library load ...

Failed: Error loading the native OCI library The native OCI driver could not be loaded. The system propertyjava.library.path contains the entries from the environment variable PATH. Check it to verify that
the expected native library directory

C:\\Oracle\\product\\11.2.0\\client_1\\bin is present and precedes any other client installations. java.library.path = C:\\sqldeveloper\\jdk\\jre\\bin;C:\\Windows\\Sun\\Java\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Oracle\\product\\10.2.0\\client_1\\bin;C:\\Oracle\\product\\11.2.0\\client_1\\bin;C:\\Oracle\\product\\11.2.0\\client_2;C:\\Oracle\\product\\11.2.0\\client_2\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\ARQDISP\\;C:\\Program ;.

Have no idea what I'm doing at this point. Could you please help?

Its missing drivers. So in my case I installed Oracle Client fromhttp://www.oracle.com/technetwork/topics/winx64soft-089540.html and set the path variable accordingly.

Here's a blog post that shows how to tell SQL Developer where and which installed client to use :

https://www.thatjeffsmith.com/archive/2014/01/oracle-sql-developer-4-and-the-oracle-client/

Restart your SQL Developer.

I had similar issue. Moving from sqldeveloper 4.0 to 4.1, imported all my connections, but in 4.1, I would get 'no ocijdbc12 in java.library.path'. I opened up my current connections (right-click on any connection and choose properties) all of which the connection Type is TNS.
The 'Connect Identifier' was checked with the connections network alias name entered there.
I checked on the 'Network Alias' check box and selected the same name and then the connection worked.
I went back to 4.0 to examine my connections there and it appears that the alias name works fine with the 'Connect Identifier' selected but not in 4.1 I had to update all my many connections to use 'Network Alias'.

Error loading the native OCI libraryThe native OCI driver could not be loaded and when trying to connect to a database i was getting no ocijdbc12 in java.library.path

For me the error was solved after i have created a new variable ORACLE_HOME with the value ....(path of the folder where the sql developer was insataled) \\jdk\\jre . Then i have added at the begging of the Path variable %ORACLE_HOME%\\bin .

At first i have created a system variable that was pointing to the folder of the installation of the dev express and that was not working

对于数据库,选择连接属性并将连接类型从 TNS 更改为 Basic 并提供连接的其他详细信息(服务名称/SID)为我解决了问题

Maybe it helps having a look into answer of my post about similar topic:

How to get Sqldeveloper 19.1 64-bit working with instantclient_12_2 on Windows enterprise PC without admin privileges?

The mentioned .bat file shows all you need. If you have admin privileges or permissions to change any environment variables, then it will probably be the better way without using .bat file.

When I try to connect using TNS I have

no ocijdbc12 in java.library.path

It is so stupid and funny, at the same time, what I found.

I get the same error and the only difference between when it is OK and when is not is...

the TNS definition in tnsnames.ora

Simply add (maybe once again if it disappeared) the TNS definition of your database, like:

XE.WORLD=
  (DESCRIPTION=
    (ADDRESS=
      (PROTOCOL=TCP)
      (HOST=localhost)
      (PORT=1521)
    )
    (CONNECT_DATA=
      (SERVICE_NAME=XE.WORLD)
      (SERVER = DEDICATED)
    )
  )

and restart SQL Developer.

Connection configuration will keep the name (XE.WORLD) even if it is already gone from tnsnames.ora. If it is not there, on the connection attempt, it will return that misleading error.

My setup: SQL Developer 4.1.4.21, ojdbc8.jar, connection to Oracle 19c.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM