首页 > 其他 > 详细

预声明之删除

时间:2017-05-20 19:22:52      阅读:298      评论:0      收藏:0      [点我收藏+]
package com.lianxi;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.util.Scanner;

public class Shanchu {

    public static void main(String[] args) throws Exception {
        Class.forName("com.mysql.jdbc.Driver");
        Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/boooks","root","tiger");
        
        PreparedStatement ps=conn.prepareStatement("delete from tb_user where userno=?");
        Scanner s=new Scanner(System.in);
        System.out.println("请输入用户编号");
        int no=s.nextInt();
        ps.setInt(1, no);
        ps.execute();
        conn.close();
        
    }

}

 

预声明之删除

原文:http://www.cnblogs.com/zyy1130/p/6882881.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!