Code example for PreparedStatement

Methods: executeUpdatesetString

0
		try { 
			////Á´½ÓÊý¾Ý¿â 
			conn = DBUtil.getConnection();
			 
			pstmt = conn.prepareStatement(sql);
			pstmt.setString(1, orderInfo.getOrderName() );
			pstmt.setString(2, orderInfo.getUserName());
			pstmt.setString(3, orderInfo.getOrderAddr());
			pstmt.setString(4, orderInfo.getOrderPhoneNo());
			pstmt.setString(5, orderInfo.getOrderMessage());
			 
			pstmt.executeUpdate();
			System.out.println("===========================update orderInfo");
		} catch (SQLException e) {
			e.printStackTrace();
		} 
 
		return true; 
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE