```java
package com.gosuncn;
import java.sql.Connection;
import java.sql.Driver;
import java.util.Properties;
public class ConnectionMain {
public static void main(String[] args) throws Exception {
Class clazz = Class.forName("com.mysql.jdbc.Driver");
Driver driver = (Driver) clazz.newInstance();
String url = "jdbc:mysql://127.0.0.1:3306/test";
Properties info = new Properties();
info.setProperty("user", "root");
info.setProperty("password", "root");
Connection connect = driver.connect(url, info);
System.out.println(connect);
}
}
```