It works, I replaced my url to "jdbc:mysql://localhost:3306/test"
Thank you very much.
Connie
> -----Original Message-----
> From: Web master [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, February 27, 2001 4:23 PM
> To: [EMAIL PROTECTED]
> Subject: Re: MySQL question - No suitable driver
>
>
> I am using the MySql and I don't have any problem. Please check my db
> code below. One more thing, if you are using win '98 then use 8.3
> filename format in the class path.
>
> public mysql_db(String uid, String pwd)
> {
>
> try
> {
> Class.forName("org.gjt.mm.mysql.Driver").newInstance();
> } catch (Exception e)
> {
> System.out.println(e);
> return;
> }
>
> try
> {
> con = DriverManager.getConnection(
> "jdbc:mysql://localhost:3306/test",uid,pwd);
> stmt = con.createStatement();
> } catch (Exception e)
> {
> System.out.println(e);
> return;
> }
> }
>
>
> Wong, Connie wrote:
>
> > Hi,
> >
> > I try to connect a servlet talk to the MySQL database.
> > I set:
> >
> > drivername = "org.gjt.mm.mysql.Driver" and
> > url = "jdbc:mysql:tbl_data"
> >
> > I downloaded MyODBC and fill in the ODBC setup and add the
> > "mm_mysql-2_0_2-bin.jar" in the classpath.
> >
> > When I run my servlet on the browser, it display the following
> Exception:
> >
> >
> > java.sql.SQLException: No suitable driver at
> > java.sql.DriverManager.getConnection(DriverManager.java:537) at
> > java.sql.DriverManager.getConnection(DriverManager.java:146) at
> > Benchmark_sql.query(Benchmark_sql.java:94) at
> > Benchmark_sql.doGet(Benchmark_sql.java:47) at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
> >
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:50
> 3)
> > at
> >
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:59
> 7)
> > at
> >
> org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:257)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
> >
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:50
> 3)
> > at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:559) at
> >
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Htt
> pC
> > onnectionHandler.java:160) at
> >
> org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:3
> 38
> > ) at java.lang.Thread.run(Thread.java:484) n
> >
> >
> > Can someon tell me what else I do miss?
> > Thanks,
> > Connie
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]