Author Topic: how do I connect to my database?  (Read 3268 times)

Offline sanoj

  • Newbie
  • *
  • Posts: 3
    • View Profile
how do I connect to my database?
« on: April 22, 2010, 02:09:48 AM »
Hi I fail to understand the concept of database hosting. How do my local application or my website access the Database hosted in freemysql ?

I have created a database "sanmydb" in freemysql. and When I try to connect to the Database Mydb from my web Application (written In java) I found It is not possible to dot it that way.

Here is the piece of code that tries to connect the remote DB


    String url = "jdbc:mysql://sql09.freemysql.net/";
    String dbName = "sanmydb";
    String driver = "com.mysql.jdbc.Driver";
    String userName = "sanoj";
    String password = "*****";

 conn = DriverManager.getConnection(url+dbName,userName,password);


How do I do it? Can any one help lease?


Free MySQL

how do I connect to my database?
« on: April 22, 2010, 02:09:48 AM »