package jdbc.test;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.util.Properties;
import org.junit.Test;
public class JDBCTest01 {
@Test
public void testConnection() throws Exception{
Class clazz = Class.forName("com.mysql.jdbc.Driver");
Driver driver =(Driver)clazz.getDeclaredConstructor().newInstance();
String url="jdbc:mysql://localhost:3306/测试用的宝贝~?serverTimezone=GMT%2B8",user="root",password ="123456";
DriverManager.registerDriver(driver);
Connection conn=DriverManager.getConnection(url,user,password);
System.out.println(conn);
}
}