Обсуждение: no suitable driver
Hi- I am getting the error message "no suitable driver" from a Tomcat application that used to work. The change that I made to cause this is that I originally accessed my database on the same server, but decided to change the URL to point my application at a database residing on another server. (Because I killed the DB horribly on the local server... but that's another story, which is told on the pgsql-admin list...) Here's a snip of what my connection looked like when it worked: <snip> private static final String driver = "org.postgresql.Driver"; private static final String user= "www-data"; private static final String pass = ""; private static final String dbUrl = "jdbc:postgresql:demo"; . . . try { Class.forName(driver); connection = DriverManager.getConnection(dbUrl, user, pass); </snip> Then I changed the dbUrl string to: private static final String dbUrl = "jdbc:postgresql//wetwang.ontko.com/demo"; After recompiling & restarting my tomcat app with *no other changes*, I started getting the "no suitable driver" message. Any thoughts about what I've done wrong here? Thanks! -Nick --------------------------------------------------------------------- Nick Fankhauser nickf@doxpop.com Phone 1.765.965.7363 Fax 1.765.962.9788 doxpop - Court records at your fingertips - http://www.doxpop.com/
> Then I changed the dbUrl string to: > > private static final String dbUrl = > "jdbc:postgresql//wetwang.ontko.com/demo"; > > Any thoughts about what I've done wrong here? This might not be the only problem, but your URL is missing a colon, should be: jdbc:postgresql://wetwang.ontko.com/demo Michael xxx
Thanks Michael & Antonio! >your URL is missing a colon Adding the missing colon took care of the problem & got my demo back on line with just 15 minutes to spare before the "business day" begins... If I were running a commercial database, I'd still be waiting for the tech support folks to wander into their office so they could promise to return my call later! The open source community is great! -Nick --------------------------------------------------------------------- Nick Fankhauser Business: nickf@doxpop.com Phone 1.765.965.7363 Fax 1.765.962.9788 doxpop - Court records at your fingertips - http://www.doxpop.com/ Personal: nick@fankhausers.com http://www.fankhausers.com
> private static final String dbUrl = "jdbc:postgresql:demo"; . > private static final String dbUrl = > "jdbc:postgresql//wetwang.ontko.com/demo"; AFAIK, "jdbc:postgresql://host/database", so there is a ":" missing. Hope that helps. Antonio P.S. My e-mail addres may not be good: remove any "panam0." from it, if present.