使用jdbc,代码如下: package com.example.mysql; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Util { final static String DRIVER_NAME = "com.mysql.jdbc.Driver"; public s