no suitable driver for jdbc:oracle:thin:#localhost:1521:servicename - java

I know, this has already been posted but none of the solutions worked. I am really stuck at this point. I am working on installation of oracle 12c SOA suite. I am installing PIP3.4. However, when I run from command, I get this error:
no suitable driver for jdbc:oracle:thin:#localhost:1521:servicename.
I also tried following URL:
no suitable driver for jdbc:oracle:thin:#localhost:1521/servicename
ojdbc6 and ojdbc7 are already present there. I am using Oracle SOA 12C and jdk1.8.0_51. Any help will be appreciated.

Try connecting to the database using SQLPLUS and also using fully qualified URL.
sqlplus scott/tiger#"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=servicename)))"
Fully qualified URL = jdbc:oracle:thin:#(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=servicename)))

Related

Oracle SQL Developer won't connect to local database, OCI library won't load

I opened Oracle SQL Developer after using it for a while a few days ago and then I run into this mysterious and infuriating issue where I cannot connect to my locally installed database. First I got a report of the JDBC driver being outdated when testing the connection, so I replaced it with the updated version and then tried again, but then got a different error saying the OCI library won't load. The path to my Oracle Databse Express Edition 18 installation that works as ORACLE_HOME is C:\app\nicho\product\18.0.0\dbhomeXE. I don't understand why the OCI library won't load, as the oci.dll and associated oci files are all in the directory the error message specifies: C:\app\nicho\product\18.0.0\dbhomeXE\bin. I tried using the Instant Client option in the Tools->Preferences->Database->Advanced section by downloading the Oracle Instant Client and changing the path, but I got the same OCI library load failed message. This problem is very significant because I need to use this software for my college project and cannot do my work. I don't understand why this error is happening.
Testing the Oracle Home located at C:\app\nicho\product\18.0.0\dbhomeXE
Testing client directory ... OK
Testing loading Oracle JDBC driver ... OK
Testing checking Oracle JDBC driver version ... OK
Driver version: 21.1.0.0.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:\app\nicho\product\18.0.0\dbhomeXE\bin is present and precedes any other client installations.
java.library.path = C:\Users\nicho\OneDrive\Documents\IS 410\sqldeveloper\sqldeveloper\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\app\nicho\product\18.0.0\dbhomeXE\bin;C:\Users\nicho\AppData\Local\Microsoft\WindowsApps;;.
As you can see, the expected native library directory is in the path, but the OCI driver will still not load. My database and installation were working fine before today. Please help. :(

Impala driver class not being found through Jaydebeapi Connection

I recently switched over from using a PC to a Mac and now for whatever reason one of my Impala drivers that worked fine is no longer found when run in Python. I keep receiving this error every time I run the script : "java.lang.RuntimeException: Class com.cloudera.impala.jdbc41.Driver not found". Please see code snippet for my connection below.
c = jaydebeapi.connect
(jclassname='com.cloudera.impala.jdbc41.Driver',
url='jdbc:impala://cloudera-impala-proxy.live.bi.xxx/;AuthMech=3;ssl=1;',
driver_args=['xxx', self.dwh_password], jars='/Users/xxx/Desktop/ImpalaJDBC41 2.jar')
Any help or suggestions are appreciated, I feel like I'm going crazy trying to get this to work.
Did you check do you have the ImpalaJDBC***.jar in your new machine.
Please check properly weather it's available at classpath/build path or not.
Edit:
You can use hive jdbc jar as well to connect with impala , just use the port of impala rather hive in jdbc url.
Looking at this error means your jar is corrupt.
First check your impalaJDBC jar
java -jar ImpalaJDBC<version>.jar
If it gives you error that means your jar is corrupt.
Download the correct jar from cloudera

Netbeans JDBC Error "Unable to find suitable driver" after JDK update

I recently upgraded my jdk from 6 to 8 when I installed Eclispe for Android. Now, in NetBeans when I try to right click on the node for the database and select connect, I get the following error:
"Unable to connect. Cannot establish a connection to jdbc:derby://localhost 1527:/Animal using org.apache.derby.jdbc.ClientDriver (Unable to find a suitable driver)."
So far, I have tried uninstalling Eclipse and reinstalling Netbeans and that didn't work. I'm not getting any errors in my code aside from a popup that says the project is missing resources. Could someone please provide instructions on how to solve this issue? I've looked on the NetBeans' website and on this forum and there doesn't seem to be a clear procedure for resolving this.
If that's not a typo on your part your JDBC URL is malformed:
jdbc:derby://localhost 1527:/Animal
That's what I copied from your question. However, the correct URL would look like
jdbc:derby://localhost:1527/Animal
With the colon before the port, not after.
At Netbeans already states that this driver was tried but failed I'm quite sure it's got nothing to do with your driver setup. But if you want todouble check:
Here's a tutorial on how to add and enable oracle thin driver. I'd think it will work the same way for derby drivers.
I solved it in the following way:
The driver that you use to connect to the database may have deleted it or changed your address. So that:
You must put it back in the address that was indicated in the databases driver>
Drivers> (driver you use to connect)
Indicate the new address where you are
The error is in the path you are specifying in the driver or in the connection.
I had the same problem when trying to connect MySQL server to NetbeansIDE. Turns out the jdbc connector was an old version. You can read about the MySQL connector versions here. Either
download the latest version of MySQL connector or
add a new driver.
My problem was solved by adding a new driver.

No suitable driver found on glassfish4

I am having a no suitable driver found issue on Ubuntu + Glassfish 4. I am trying to connect to a Postgres instance on Amazon RDS. Except I have added the required driver to everywhere I know:
-Domain1 lib
-glassfish lib
-java-7-oracle lib
Please help me. I have no idea why this is not working.
Thanks in advance...
I'm such an idiot. JDBC string was wrong due to bad copy-paste! That said - would be nice if GF was all "hey man your JDBC string looks bogus".

can oci driver for 11g (odbc5.jar) work with 10g client?

I need to connect to Oracle9,10 and 11 in my java application.The client will always be present where the app will be run and I want the app to just work with username,password and instance (specified in tnsnames.ora).Hence I would like oci drivers with a connection string of type : jdbc:oracle:oci:#testora .Im using the driver: oracle.jdbc.driver.OracleDriver.
I have a 10g client and am using jdk1.5. When I use the ojdbc14 jar from client lib path the app runs.
But if I use the ojdbc5 driver then the app fails with
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc11 in java.
library.path
exception.
What im looking for is a way to package a single jar(ojdbc5/ojdbc14) and a single driver which will use oci drivers to connect to the client that is present on local machine(9/10/11).This is the way I would prefer it.
If this is not possible can I search the unix box for oracle version,pick up the correct jar and then use it in classpath when invoking the app which is in jar format?
Thanks,
Fell
java.lang.UnsatisfiedLinkError: no ocijdbc11 in java.library.path
This means that you are missing a DLL (ocijdbc11.dll) in the Java library path. Make sure you have that DLL and start your program like this:
java -Djava.library.path=C:\mydirwiththedll com.mypackage.MyProgram
ojdbc5.jar is intended to work with jdk1.5.x either you are connecting to Oracle 10 or 11g shouldn't matter, ojdbc14.jar was intended for jdk1.4.x

Categories