企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
```java package com.gosuncn; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; public class ConnectionMain { public static void main(String[] args) throws Exception { DriverManager.registerDriver((Driver) Class.forName("com.mysql.jdbc.Driver").newInstance()); Connection connect = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/test", "root", "root"); System.out.println(connect); } } ```