0

I'm working on a RESTful service in Eclipse with a tomee server and a derby database. I've got the RESTful service mocked up without a database connection and all of my requests are acting as expected. Now I'm trying to incorporate the derby database and I'm getting this:

java.sql.SQLException: No suitable driver found for jdbc:derby:Students

I've linked derby.jar. I've also set up a non-web application that connects to the database and it works fine. The problem only occurs if I try to initialize the database within my RESTful application. Is there something I'm missing in how to incorporate derby into a RESTful web service?

Ryan
  • 257
  • 4
  • 14
  • this is a duplicate of http://stackoverflow.com/questions/3816015/sqlexception-no-suitable-driver-found-for-jdbcderby-localhost1527 – Shiraaz.M Apr 25 '14 at 16:27
  • I looked at that particular question, and I don't understand how it could be a malformed URL or the driver isn't loaded when I have it working in an offline environment just fine. – Ryan Apr 25 '14 at 16:32
  • Not sure from the information provided how your web application is setup (jdbc or jpa/hibernate?) - can you post some configuration code (web.xml and persistence configuration code) – Shiraaz.M Apr 25 '14 at 16:41
  • It's jdbc, I haven't generated a web.xml file. – Ryan Apr 25 '14 at 17:43
  • The suitable driver is the EmbeddedDriver, which is in derby.jar. Since derby.jar is all that you need, either you didn't correctly include it in your CLASSPATH (what, exactly, do you mean by "I've linked derby.jar"?), or your code isn't exactly right (See http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html for an example) – Bryan Pendleton Apr 25 '14 at 20:10
  • I used the eclipse build path, which added `` to classpath. – Ryan Apr 25 '14 at 21:40

0 Answers0