import java.sql.*;
class Example9_2 {
	public static void main(String[] args) {
		Connection con = null;
		Statement st = null;
		try { // 加载JDBC纯驱动器
			Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
			String url = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=sale";
			Connection conn = DriverManager.getConnection(url, "sa", "sa");
			String sql = "update goodsStore set priceIn=200 where goodsID='1'";
			st = con.createStatement();
			int n = st.executeUpdate(sql);    
			if (n > 0)
				System.out.println("数据修改成功");
			else
				System.out.println("数据修改失败");
			con.close();
		} catch (Exception e) {
			System.out.println("" + e);
		}
	  }
}