Help get this topic noticed by sharing it on Twitter, Facebook, or email.

connect to java to cleardb

Hi I want to connect with azure. I have connection string. I am getting
java.sql.SQLException: No suitable driver found for....

us*******************.cloudapp.net/as_6aa*******d128...
Please give me some sample to connect with azure to cleardbmysql...

this.driver = "com.mysql.jdbc.Driver";
this.url = "us-cdbr-azure-west-a.cloudapp.net/as_************128";
this.userName = "************";
this.password = "03*********2";

Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection(url, userName, password);
This is working fine for java to mysql...
1 person likes
this idea
+1
Reply
  • Hello,

    We do not have sample code for Java connections as there is nothing special about ClearDB; we use standard mysql binaries to drive our servers.

    My understanding, however, is that your url should be of the format

    jdbc:mysql://servername:port/dbname

    where "port" in this case is the standard mysql port, 3306.

    If you google the exception string you're getting, you will find many pages showing sample code in the correct format.

    I hope this is helpful.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated