java如何连接mysql数据库
import java.sql.*;
public class connectMySQL
{
public static void mian(String args[])
{
String driver="org.mm.mysql.Driver";
String url="jdbc:mysql://localhost:3360/mysql?";
String user="root";
String password="";
try
{
Class.forName(driver);
}
catch(Exception e)
{
System.out.println("无法加载驱动程序:"+driver);
}
try
{
Connection con=DriverManager.getConnection(url,user,password);
if(!con.isClosed())
System.out.println("数据库连接成功!");
con.close();
}
catch(SQLException ee)
{
//System.out.println("数据库连接失败!");
System.out.println(ee.getMessage());
}
}
}
这些代码有什么错误啊?