Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> help: naive programmer try to talk to a database
Hello all,
My friend has set up a database, whose has the follow information:
url = "cs169-ab_at_pentagon.cs.berkeley.edu:3306/"; usr = "root"; pwd = "loches";
Because of that, I have written a driver.java (who has the main), a searcher.java (who has a public searcer class) as follow:
public searcher () {
try { //Don't know for sure what it does, will get back to it later //Class.forName("org.postgresql.Driver"); url = "cs169-ap_at_pentagon.cs.berkeley.edu:3306/"; usr = "root"; pwd = "loches1"; con = DriverManager.getConnection(url, usr, pwd); stmt = con.createStatement();
}catch (Exception ex) {
System.out.println("Searcher Constructor error"); ex.printStackTrace(); //Don't know for sure what it does.
}
However, it compilers, but it gives this error:
pentagon [23] ~/cs169 > java driver
Searcher Constructor error
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code) at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code) at searcher.<init>(searcher.java, Compiled Code) at driver.<clinit>(driver.java:6)Exception in simpleSearch
Would someone kindheartedly give me a little hint? Any help will be much appreciated.
Best,
Mo
Received on Tue Apr 02 2002 - 19:45:07 CST
![]() |
![]() |