import java.sql.*;
class update1 {
public static void main(String args[]){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");}
catch(ClassNotFoundException ce){
System.out.println("类没有找到");}
try{
Connection conn=DriverManager.getConnection("jdbc:odbc:myDB");
Statement stmt=conn.createStatement();
String sql="update employee set no='2002'where name='肖遥子'";
stmt.executeUpdate(sql);
sql="update employee set salary=3500 where no='1003'";
stmt.executeUpdate(sql);
stmt.close();
conn.close();
}
catch(SQLException e){
System.out.println("SQL异常");}
}}请高手帮一下忙了,搞了好久都没出来
class update1 {
public static void main(String args[]){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");}
catch(ClassNotFoundException ce){
System.out.println("类没有找到");}
try{
Connection conn=DriverManager.getConnection("jdbc:odbc:myDB");
Statement stmt=conn.createStatement();
String sql="update employee set no='2002'where name='肖遥子'";
stmt.executeUpdate(sql);
sql="update employee set salary=3500 where no='1003'";
stmt.executeUpdate(sql);
stmt.close();
conn.close();
}
catch(SQLException e){
System.out.println("SQL异常");}
}}请高手帮一下忙了,搞了好久都没出来
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货