日期:2014-05-20 浏览次数:20846 次
package com.test.zhuce; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Cshi { public static void main(String[] args) throws ClassNotFoundException { Connection con = null; Statement sql=null; ResultSet rs=null; String uid="12092401"; String sid="2221"; Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver"); try { con=DriverManager.getConnection("jdbc:odbc:lib","",""); } catch (SQLException e) { System.out.println("执行2"); } String sqle="UPDATE yonghu set id1='"+sid+"' WHERE id="+"\'"+uid+"\'"; try { sql.executeUpdate(sqle); } catch (SQLException e) { System.out.println("执行"); } } }