import java.sql.*;
public class StudentInfoModify
{
public static void main(String[] args)
{
Connection con;
Statement stmt;
ResultSet rs;
String sql;
String number,name;
int speciality;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e){}
try
{
con=DriverManager.getConnection("jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=E:/实训课/电商1401马仲涛/ECStudent.mdb","","");
stmt=con.createStatement();
sql="update StudentInfo set Speciality=电机与电气 where Number='10ZD140115'";
int m=stmt.executeUpdate(sql);
rs=stmt.executeQuery("select * from StudentInfo");
while(rs.next())
{
String Number=rs.getString(2);
String Name=rs.getString(3);
String Speciality=rs.getString(7);
System.out.print("学号:"+Number+"\t");
System.out.print("姓名:"+Name+"\t");
System.out.print("专业:"+Speciality+"\t");
}
con.close();
}
catch(SQLException e)
{ System.out.println(e);}
}
}
找不到啊