*
The moose likes JDBC and the fly likes JDBC:No Suitable Driver Found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC:No Suitable Driver Found" Watch "JDBC:No Suitable Driver Found" New topic
Author

JDBC:No Suitable Driver Found

amol bakre
Greenhorn

Joined: May 21, 2001
Posts: 25
Hi,
I am not sure but maybe a similar looking topic might have been posted earlier, in which case i would appreciate if you can post link..

Anyway, i'll describe my problem. I have been trying to write some application source (coding after a long time) and i was getting sql errors, ora-12505, listener does not know of the SID.
I found that probably it had something to do with the Oracle installation and found that changing the jdbc url to the entire string contained in tnsnames.ora file might do the trick.
Well at least i am now getting a different error and that is the NO suitable driver found. I have been trying to resolve it did hundreds of things, but mayb missing something here. To check i just create a simple java class that does nothing except for to get the connection to the DB. I changed and tried with all of the oracle jdbc drivers, classes12.jar, odbc14.jar but have not been able to do away with the error..Please suggest something that i can do to fix this. I tried for two days to hundreds of things so i am already a little out of time, would appreciate if you can post urgently..Thanks a lot in advance..
Am
Aurelian Tutuianu
Ranch Hand

Joined: May 13, 2004
Posts: 86
The driver class is not on the class path of the server. Maybe copying jar to one of the lib folders of server would do the trick.


http://javasign.blogspot.com/
amol bakre
Greenhorn

Joined: May 21, 2001
Posts: 25
Hi,

O i tried several option with that too, i am using tomcat for development right now but will be porting it later to weblogic., anyway, i have built the application archive with the driver jar in the lib folder, i kept the driver in server/lib, common/lib everywhere, tried keeping it everywhere too. i changed to source to specifically import the OracleDriver class into the source and register the driver by doing new DriverManager(), and that succeeds!! but when i try to get the connection it gives me this error..
And now i am just trying to find what is going wrong by making one simple standalone class with jar in the folder and executing it and still getting the same error, so i am guessing probably the error is not the classpath, maybe the URL!!, but i tried with the conventional URL, jdbcracle..etc and i get an error saying Listener could not find the SID, and if i use the entire string in the tnsnames.ora file, as maybe the oracle installation might be running RAC etc..
I dont know if there is anything else that might cause this problem..
amol bakre
Greenhorn

Joined: May 21, 2001
Posts: 25
O, by the way, thanks for replying and so fast..
Aurelian Tutuianu
Ranch Hand

Joined: May 13, 2004
Posts: 86
could you post the whole url here? I mean no real data, just to verify syntax?
amol bakre
Greenhorn

Joined: May 21, 2001
Posts: 25
Hi,

When i use this::
jdbcracle:thin:@10.40.51.41:1531:x.y.z.a
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

and when i use this::
(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT = 1531)(CONNECT_DATA =(SERVICE_NAME = x.y.z.a)))

then it results into a No Suitable driver found..

Let me know if you find something..thank you..
amol bakre
Greenhorn

Joined: May 21, 2001
Posts: 25
Hi,

I solved my problem, i played with the url, intentionally malformed it and then i got a message from the compiler and the valid / expected format..lol..
the format it said that should be used is : "//host:port/service_name"

is a little different, maybe something changed 1.4 onwards,..will find out..

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC:No Suitable Driver Found
 
Similar Threads
Tomcat 5.5 and simple JDBC program issue
My first ever jdbc Connection
What is this No Suitable Driver exception?
New to jdbc,please help
Jar file exception due to not finding Oracle driver but other standalone programs can use it