标签:style blog io color ar sp div on 问题
1 //sql语句,参数用?代替-----一定要是英文的? 2 String sql="INSERT INTO s_user (NAME,PASSWORD) VALUES (?,?)"; 3 try { 4 pstmt=connection.prepareStatement(sql); 5 pstmt.setString(1, "小黄黄");//设置参数值,索引从1开始 6 pstmt.setString(2, "1234567890"); 7 int result= pstmt.executeUpdate(); 8 }
MySql中PreparedStatement对象与Statement对象
标签:style blog io color ar sp div on 问题
原文地址:http://www.cnblogs.com/liuwt365/p/4097025.html