Hi frnds..
I have googled it and done research but unable to connect to mysql.please help me out and tell me how to connect.
I have down loaded my sql and changed the port to 8001 and given some user name and pass word
and have written this code
import java.sql.*;
public class connect
{
public static void main (String[] args)
{
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection ("jdbc:mysql://localhost/test", "root", "konh");
System.out.println ("Database connection established");
}
catch (Exception e)
{
System.out.println ("Exception raised trying again");
}
}
}
Edited by: maganti on Apr 7, 2009 3:10 AM