delete from table where ID= ??

解决方案 »

  1.   

    <%@ page contentType="text/html;charset=gb2312"%> 
    <%@ page import="java.sql.*"%> 
    <html> 
    <body> 
    <%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); 
    String url="jdbc:oracle:thin:@localhost:1521:orcl"; 
    //orcl为你的数据库的SID 
    String user="scott"; 
    String password="tiger"; 
    Connection conn= DriverManager.getConnection(url,user,password); 
    Statement stmt=conn.createStatement(); 
    String sql="delete from table where ID= 123"; 
    stmt.executeQuery(sql); 
    stmt.close(); 
    conn.close(); 
    %> 
    </body> 
    </html>