修改数据库表出错 高手看下哦
代码如下
try
{
sql="update student set age='"+Age+"',cla='"+Cla+"' where stuName='"+Name+"'";
conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/management","root","4460072");
stm=conn.createStatement();
rs=stm.executeQuery(sql);
if(rs.next())
{
JOptionPane.showMessageDialog(null, "修改成功!");
}
}
catch(SQLException ee)
{
System.out.println("连接数据库出错!");
}
提示的错误是 连接数据库出错
哪个地方写的不对阿?