插入,更新
try{ 
odbcconn = DriverManager.getConnection("jdbc:odbc:qingzheng"); 
odbcstmt = odbcconn.createStatement(); 
odbcstmt1 = odbcconn.createStatement(); 
odbcstmt.executeUpdate("insert into result (item,receive,date_t,weizhi)values(\'"+item1+"\',\'"+money1+"\',\'"+now+"\',\'"+wei+"\')");
odbcstmt.close();
 
odbcstmt1.executeQuery("update badminton set state='使用'   where ground='"+wei+"' ");
odbcstmt1.close();
odbcconn.close(); 
}catch (SQLException e) 
{out.println (e); 

%> 删除,查询都一样,把SQL语句换了就行

解决方案 »

  1.   

    Connection con=DriverManager.getConnection(URL,User,password);
    System.out.println("connect succesfull"); //连接成功打印"连接成功"
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery("select * FROM smvpn.RPLOM");
    while(rs.next()){//以下可以写要执行的操作查询语句
      

  2.   

    可以,不过你要用jdbc.odbc桥,呵呵,其实很简单,那一本入门的jsp书上应该都有查询,删除,插入的源代码,呵呵
      

  3.   

    应该把这些写成一个通用的bean