MySql server upgrade from 4.0 to 5.0 jdbc will not connect anymore.

This is working as long as MySql 4.0 is on the server but not if MySql 5.0 is there.

mm.mysql-2.0-bin.jar is used

public class Data {
   static Connection c;
   private String connectString = "jdbc:mysql://ipAdress/databaseName?user=userLogin&password=userPassord";
   private int attempts, limit = 2;

      public Data() {
            try  {
                  Class.forName("org.gjt.mm.mysql.Driver").newInstance();
            } catch (Exception e) {
                  e.printStackTrace();
            }
            while ((c==null) && (attempts<limit)) {
                  attempts++;
                  try {
                        c = DriverManager.getConnection(connectString);
                  } catch (Exception e) {
                        e.printStackTrace();
                  }
            }
      }

// more code...
SolangeRichardAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hoomanvCommented:
MM.MySQL is no longer supported
use connector/j instead
http://dev.mysql.com/downloads/connector/j/3.1.html

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CEHJCommented:
Make sure the right database is listening on the default port
SolangeRichardAuthor Commented:
Would you know what I have to change in my code to use connectors instead?
I've tried with no success
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

hoomanvCommented:
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("jdbc:mysql:///database", "user", "pass");
CEHJCommented:
>>to use connectors instead?

What do you mean by this?
hoomanvCommented:
which exception is thrown when you try to connect to DB
print stack trace here
SolangeRichardAuthor Commented:
Oups I did not change this line :
Class.forName("org.gjt.mm.mysql.Driver").newInstance();

to this one...
Class.forName("com.mysql.jdbc.Driver").newInstance();

This is why I wasnt able to make it work!

Thank you hoomany.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.