importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.PreparedStatement;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;public classJDBC01 {public static void main(String[] args) throwsSQLException {
delete(2);
}public static void selectAll() throwsSQLException {//注册驱动 使用驱动连接数据库
Connection con = null;
Statement stmt= null;
ResultSet rs= null;try{//数据库的连接
con =JDBCUtils.getConnection();//数据库的增删改查
stmt =con.createStatement();//返回一个结果集
rs =stmt.executeQuery("select * from garytb");while(rs.next()) {//System.out.println(rs.getString(1)+","+rs.getString(2)+","+rs.getString(3));
System.out.println(rs.getString("id")+","+rs.getString("username")+","+rs.getString("password"));
}
}catch(Excep