The moose likes JDBC and Relational Databases and the fly likes Derby java.sql.SQLException: No suitable driver found for URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Derby java.sql.SQLException: No suitable driver found for URL" Watch "Derby java.sql.SQLException: No suitable driver found for URL" New topic
Author

Derby java.sql.SQLException: No suitable driver found for URL

oz erudio
Greenhorn

Joined: Mar 09, 2012
Posts: 4
My code is below:




I use the three conventions but it gives the same exception I enclosed below.. WHYY?



java.sql.SQLException: No suitable driver found for URL
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.example.ch3.iteration2.Database.lookupFullname(Database.java:32)
at org.example.ch3.iteration2.HelloServlet.doGet(HelloServlet.java:48)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20080
    
  30

Did you perhaps forget to load that class?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
oz erudio
Greenhorn

Joined: Mar 09, 2012
Posts: 4
No, I forgot to disconnect from the database before running the application. Derby does not allow to be shared by multiple processes..
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20080
    
  30

The error message would seem to indicate differently. Right now the driver appears to just say that it's not valid at all for the connection String, so DriverManager skips it completely. If I'd have written that driver I would have chosen a different error message and throw an SQLException from the driver itself.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Derby java.sql.SQLException: No suitable driver found for URL
 
It's not a secret anymore!