Re: [JDBC] "No Suitable Driver"
Guy, Send me the pertinent code where you are loading the driver Dave -Original Message- From: Guy McArthur [mailto:[EMAIL PROTECTED]] Sent: October 25, 2001 6:28 PM To: Dave Cramer Cc: [EMAIL PROTECTED] Subject: RE: [JDBC] "No Suitable Driver" Huh. Well I have set up Jive Forums 2.1.1 (jivesoftware.com) using postgres jdbc and it seems to work fine. Also in the Resin java web-app server I set up a DataSource pool of postgres connections, and that seems to work fine, fetching a connection, doing a query and all that. I haven't looked at the source to see how they are doing it. But it absolutely does not work from my command-line test app no matter which way I've tried it. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] "No Suitable Driver"
You need to load the driver first and then get the connection, also the url for the connection s/b jdbc:postgresql://hostname/test&user=test&password=test" Assuming your database name is test So your code needs to execute Class.forName("org.postgresql.Driver") And then Connection db = DriverManager.getConnection("jdbc:postgresql://hostname/test"test",test" ); Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Guy McArthur Sent: October 24, 2001 7:13 PM To: [EMAIL PROTECTED] Subject: [JDBC] "No Suitable Driver" Hi, I'm trying to get a small test program going. I have built PostgreSQL 7.1.3 on RedHat 6.2 with --java, installed and created databases, verified with psql. The postgresql.jar is on my classpath. My pg_hba.conf has: localall password host all 127.0.0.1 255.255.255.255 password Here is my code: import java.sql.*; public class PostgresTest { public static void main(String[] args) { try { Connection db = DriverManager.getConnection("jdbc.postgresql:test&user=test&password=tes t"); // I've also tried all the permutations of getConnection() and urls. // db, user, and password names have been changed to protect the innocent // I've also tried Class.forName("org.postgresql.Driver") and // Class.forName("org.postgresql.Driver").newInstance() instead of the arg. db.close(); } catch(Throwable t) { t.printStackTrace(System.out); } } } -- Running it with: java -Djdbc.drivers=org.postgresql.Driver PostgresTest where the db has been started by user postgres with: /usr/local/pgsql/bin/postmaster -i -D /data/pgsql >/data/pgsql/pgsql.log 2>&1 & And the error is: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getConnection(DriverManager.java:537) at java.sql.DriverManager.getConnection(DriverManager.java:199) at PostgresTest.main(PostgresTest.java:6) What is wrong? -- Guy McArthur * email{[EMAIL PROTECTED]} http{guymcarthur.com} ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
[JDBC] "No Suitable Driver"
Hi, I'm trying to get a small test program going. I have built PostgreSQL 7.1.3 on RedHat 6.2 with --java, installed and created databases, verified with psql. The postgresql.jar is on my classpath. My pg_hba.conf has: localall password host all 127.0.0.1 255.255.255.255 password Here is my code: import java.sql.*; public class PostgresTest { public static void main(String[] args) { try { Connection db = DriverManager.getConnection("jdbc.postgresql:test&user=test&password=test"); // I've also tried all the permutations of getConnection() and urls. // db, user, and password names have been changed to protect the innocent // I've also tried Class.forName("org.postgresql.Driver") and // Class.forName("org.postgresql.Driver").newInstance() instead of the arg. db.close(); } catch(Throwable t) { t.printStackTrace(System.out); } } } -- Running it with: java -Djdbc.drivers=org.postgresql.Driver PostgresTest where the db has been started by user postgres with: /usr/local/pgsql/bin/postmaster -i -D /data/pgsql >/data/pgsql/pgsql.log 2>&1 & And the error is: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getConnection(DriverManager.java:537) at java.sql.DriverManager.getConnection(DriverManager.java:199) at PostgresTest.main(PostgresTest.java:6) What is wrong? -- Guy McArthur * email{[EMAIL PROTECTED]} http{guymcarthur.com} ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] no suitable driver
> 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. ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [JDBC] no suitable driver
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: [EMAIL PROTECTED] Phone 1.765.965.7363 Fax 1.765.962.9788 doxpop - Court records at your fingertips - http://www.doxpop.com/ Personal: [EMAIL PROTECTED] http://www.fankhausers.com ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [JDBC] no suitable driver
> 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 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[JDBC] 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: 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); 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 [EMAIL PROTECTED] Phone 1.765.965.7363 Fax 1.765.962.9788 doxpop - Court records at your fingertips - http://www.doxpop.com/ ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re:RE: [JDBC] no suitable driver
thanks to all for your help, this a url problem, i thought that the driver problem deal with jar file and not the code in jsp... newbie in java and postgresql is hard ! Matthieu -- Mail d'origine -- Matthieu Can you send us the code which causes the problem. It is very difficult to diagnose with this much information Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Matthieu Guyonnet-Duluc Sent: August 3, 2001 5:38 AM To: [EMAIL PROTECTED] Subject: [JDBC] no suitable driver hi, i've this typical error, i've read some stuff about it but many concern applets, and my problem comes from a jsp page. i've the jar of distribution load from TOMCAT in it lib directory. before that i've the 'unable to load class...' Now that i pt the jar in tomcat/lib nad modify the script to generate a good classpath value i've the "no suitable driver" My configuration is APACHE 1.3.20/WIN NT 4.0 SP 4/TOMCAt 3.2/POSTGRESQL 7.1.2 Thank for help ! Matthieu ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl
RE: [JDBC] no suitable driver
Matthieu Can you send us the code which causes the problem. It is very difficult to diagnose with this much information Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Matthieu Guyonnet-Duluc Sent: August 3, 2001 5:38 AM To: [EMAIL PROTECTED] Subject: [JDBC] no suitable driver hi, i've this typical error, i've read some stuff about it but many concern applets, and my problem comes from a jsp page. i've the jar of distribution load from TOMCAT in it lib directory. before that i've the 'unable to load class...' Now that i pt the jar in tomcat/lib nad modify the script to generate a good classpath value i've the "no suitable driver" My configuration is APACHE 1.3.20/WIN NT 4.0 SP 4/TOMCAt 3.2/POSTGRESQL 7.1.2 Thank for help ! Matthieu ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
[JDBC] no suitable driver
hi, i've this typical error, i've read some stuff about it but many concern applets, and my problem comes from a jsp page. i've the jar of distribution load from TOMCAT in it lib directory. before that i've the 'unable to load class...' Now that i pt the jar in tomcat/lib nad modify the script to generate a good classpath value i've the "no suitable driver" My configuration is APACHE 1.3.20/WIN NT 4.0 SP 4/TOMCAt 3.2/POSTGRESQL 7.1.2 Thank for help ! Matthieu ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
RE: [JDBC] No suitable driver
Title: RE: [JDBC] No suitable driver Try passing the driver in the command line, like this: java -Djdbc.drivers=org.postgresql.Driver ... -Original Message- From: Peter Mezzina [mailto:[EMAIL PROTECTED]] Sent: Friday, June 15, 2001 2:58 PM To: [EMAIL PROTECTED] Subject: [JDBC] No suitable driver I have Tomcat 3.2.1 and Postgres 7.0.3 running well in Solaris and I have installed the JDBC driver, jdbc7.0-1.2.jar, in both the /lib and a second directory off of the tomcat tree. With the jar file in the classpath the driver works fine from an application but produces the error "No suitable driver" when called from within a servlet. Having combed through the jdbc mailing list I have tried placing the jar file in the /lib (a restart of tomcat references the existence of the jar file in its output) and I have set the driver's path for wrapper.classpath in tomcat.properties for the parameter wrapper.classpath and set the driver name for wrapper.bin.parameters. Is there anyone who might have some advise about whatelse needs to be done for this? -Peter Mezzina [EMAIL PROTECTED] ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl
[JDBC] No suitable driver
I have Tomcat 3.2.1 and Postgres 7.0.3 running well in Solaris and I have installed the JDBC driver, jdbc7.0-1.2.jar, in both the /lib and a second directory off of the tomcat tree. With the jar file in the classpath the driver works fine from an application but produces the error "No suitable driver" when called from within a servlet. Having combed through the jdbc mailing list I have tried placing the jar file in the /lib (a restart of tomcat references the existence of the jar file in its output) and I have set the driver's path for wrapper.classpath in tomcat.properties for the parameter wrapper.classpath and set the driver name for wrapper.bin.parameters. Is there anyone who might have some advise about whatelse needs to be done for this? -Peter Mezzina [EMAIL PROTECTED] ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl