png](/img/bVFwcv)
比如输出ID为4的那一行
Scanner a = new Scanner(System.in);
o=a.nextInt();
if(o==1)
{
System.out.println("请输入需要查找的姓名");
name =a.next();
cx.cx1(name);
}
else if(o==2)
{
System.out.println("请输入需要查找的年龄");
age = a.next();
cx.cx2(age);
}
......
下面为接收参数
public static void cx2(String age)throws Exception{
Connection con = null;//定义引用
PreparedStatement stmt = null;
try {
String driverClassName = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/txl";
String username = "root";
String password = "