⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showordersutil.java

📁 主要是航空预订系统
💻 JAVA
字号:
/**
 * 
 */
package com.air.backend.util;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.air.exceptions.AirException;
import com.air.form.DestineForm;
import com.air.model.Destine;
import com.air.persistence.DataSrcUtil;
import com.air.persistence.IsqlDataSource;
import com.air.util.ValHelper;

/**
 * @author jelly_yang
 *
 */
public class ShowOrdersUtil {

	private static Log log = LogFactory.getLog(ShowOrdersUtil.class);
	private ShowOrdersUtil() {
		// TODO Auto-generated constructor stub
	}

	public static class ShowOrdersUtilHolder{
		static ShowOrdersUtil showOrdersUtil = new ShowOrdersUtil();
	}
	
	public static ShowOrdersUtil getInstance(){
		return ShowOrdersUtilHolder.showOrdersUtil;
	}
	
	public List<Destine> showOrders()throws AirException{
		List<Destine> list = new ArrayList<Destine>();
		List<Map<String,String>> result = new ArrayList<Map<String,String>>();
		String sSql = "select * from destine";
       
		IsqlDataSource src = DataSrcUtil.getInstance().getDataSource();
		Connection conn = null;
		log.debug("retrieveFight() -- sSql["+ sSql+ "]");
		try
		{
			conn = src.getConnection();
			result = src.executeRetrieve(conn, sSql);
		}
		catch(SQLException se)
		{
			log.error("getUsers() caught SQLException: " + se);
		}
		catch(Exception ex)
		{
			log.error("getUsers() caught Exception: " + ex);
		}
		finally
		{
			src.closeConn(conn);
		}
		if(!result.isEmpty())
		{
			int size = result.size();
			
			for( int i=0;i<size;i++)
			{
				Map<String,String> resultMap = result.get(i);
				String destineId = ValHelper.getInstance().getValue(resultMap, "did");
				String fightId = ValHelper.getInstance().getValue(resultMap, "fid");
				String adultNum = ValHelper.getInstance().getValue(resultMap, "adult_num");
				String childNum = ValHelper.getInstance().getValue(resultMap, "child_num");
				String babyNum = ValHelper.getInstance().getValue(resultMap, "baby_num");
				String contactPerson = ValHelper.getInstance().getValue(resultMap, "contact_person");
				String contactPhone = ValHelper.getInstance().getValue(resultMap, "contact_phone");
				String insurancePrice = ValHelper.getInstance().getValue(resultMap, "insurance_price");
				String insuranceNum = ValHelper.getInstance().getValue(resultMap, "insurance_num");
				String distributeStyle = ValHelper.getInstance().getValue(resultMap, "distribute_style");
				String payStyle = ValHelper.getInstance().getValue(resultMap, "pay_style");
				String sendAddress = ValHelper.getInstance().getValue(resultMap, "send_address");
				String postAddress = ValHelper.getInstance().getValue(resultMap, "post_address");
				String takeSelfAddress = ValHelper.getInstance().getValue(resultMap, "take_self_address");
				String sendDate = ValHelper.getInstance().getValue(resultMap, "send_date");
				String sendTime = ValHelper.getInstance().getValue(resultMap, "send_time");
				String post = ValHelper.getInstance().getValue(resultMap, "post");
				
				Destine destine = new Destine();
				destine.setDestineId(destineId);
				destine.setFightId(fightId);
				destine.setAdultNum(adultNum);
				destine.setChildNum(childNum);
				destine.setBabyNum(babyNum);
				destine.setContactPerson(contactPerson);
				destine.setContactPhone(contactPhone);
				destine.setInsurancePrice(insurancePrice);
				destine.setInsuranceNum(insuranceNum);
				destine.setDistributeStyle(distributeStyle);
				destine.setPayStyle(payStyle);

				destine.setSendAddress(sendAddress);
				destine.setPostAddress(postAddress);
				destine.setTakeSelfAddress(takeSelfAddress);
				destine.setSendDate(sendDate);
				destine.setSendTime(sendTime);
				destine.setPost(post);
	
			    list.add( destine );
			}
		}
		return list;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -