Hi,
Thank you,
I added the line
 Class.forName("com.mysql.jdbc.Driver");

bt I know get a stack exception saying
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

any idears?
-Ted
On Dec 7, 10:58 pm, Kamal Chandana Mettananda <lka...@gmail.com>
wrote:
> It seems you haven't loaded the driver from your class.
>
> Class.forName("com.mysql.jdbc.Driver");
>
> ---------------------------------------
> Kamal Mettanandahttp://lkamal.blogspot.com
>
>
>
> On Tue, Dec 8, 2009 at 5:16 AM, tedpottel <tedpot...@gmail.com> wrote:
> > hHi,
> > I’m trying to connect to a MySql databse and keep getting a
> > java.sql.SQLException: No suitable driver found for jdbc:mysql://
> > localhost:3306/mysql
> > This is what I did
> > 1.      installed the driver –
> > a.      copied the mysql-connector-java-5.1.10-bin to java/jre6/lib/ext
> > folder
> > 2.      wrote the following program
> >   try {
> >      String url =
> >            "jdbc:mysql://localhost:3306/mysql";
> >      Connection con =
> >                     DriverManager.getConnection(
> >                                 url,"root", "");
> >      con.close();
> >    }catch( Exception e ) {
> >      e.printStackTrace();
> >    }//end catch
>
> > The exception keeps going off.
> > - Ted
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Java EE (J2EE) Programming with Passion!" group.
> > To post to this group, send email to
> > java-ee-j2ee-programming-with-passion@googlegroups.com
> > To unsubscribe from this group, send email to
> > java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com<java-ee-­j2ee-programming-with-passion%2bunsubscr...@googlegroups.com>
> > For more options, visit this group at
>
> >http://groups.google.com/group/java-ee-j2ee-programming-with-passion?...- 
> >Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

Reply via email to