private void InsertPackageProductsSuppliers() {
		
		try {
			// creates DB connection
			Class.forName("oracle.jdbc.driver.OracleDriver");
			Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "ictoosd", "ictoosd");
			Statement stmt = conn.createStatement();
						
			// create date format of selected start date
			Calendar startDate = dcStartDate.getCalendar();
			String startDateStr = startDate.get(Calendar.YEAR) + "/" 
			                  + (startDate.get(Calendar.MONTH) + 1) + "/" 
					          + startDate.get(Calendar.DAY_OF_MONTH)
					          + " 00:00:00";
			
			// create date format of selected end date
			Calendar endtDate = dcEndDate.getCalendar();
			String endDateStr = endtDate.get(Calendar.YEAR) + "/" 
			                  + (endtDate.get(Calendar.MONTH) + 1) + "/" 
					          + endtDate.get(Calendar.DAY_OF_MONTH)
					          + " 00:00:00";
			
			System.out.println("dcStartDate=" + startDateStr);
			
			// Get the new package id.
			packageID = getMaxPackageId() + 1;
			
			// INSERT SQL
			String sql = "insert into packages ";
			sql += "(";
			sql += "packageid,";
			sql += "pkgagencycommission,";
			sql += "pkgbaseprice,";
			sql += "pkgdesc,";
			sql += "pkgenddate,";
			sql += "pkgname,";
			sql += "pkgstartdate";
			sql += ") values (";
			sql += packageID + ",";
			sql += txtAgcyCms.getText().replace("$", "") + ",";
			sql += txtBasePrice.getText().replace("$", "") + ",";
			sql += "'" + taDescription.getText() + "',";
			sql += "TO_DATE('" + endDateStr + "', 'yyyy/mm/dd hh24:mi:ss')" + ",";
			sql += "'" + txtPkgName.getText() + "',";
			sql += "TO_DATE('" + startDateStr + "', 'yyyy/mm/dd hh24:mi:ss')";
			sql += ")";
			
			System.out.println(sql);
			// executes SQL
			int rowsInserted = stmt.executeUpdate(sql);
			
			// no record updated
			if (rowsInserted == 0)
			{
				//JOptionPane.showMessageDialog(null, "Zero row inserted.");
			// recored updated
			} else {
				//JOptionPane.showMessageDialog(null, rowsInserted + " rows successfully inserted.");
			}
			
			// get selected list item index
			int[] selIdx = lstProSup.getSelectedIndices();		
			
			// loop through selected list items
			int rowsPpsInserted = 0;
			for ( int i = 0; i < selIdx.length; i++){			
			
					// Insert to Packages_Products_Suppliers
					// INSERT SQL
					sql = "insert into Packages_Products_Suppliers ";
					sql += "(";
					sql += "packageid,";
					sql += "productSupplierid";
					sql += ") values (";
					sql += packageID + ",";
					sql += lstVals[selIdx[i]]; // sets the productsupplierID of selected item
					sql += ")";
					
					System.out.println(sql);
					// executes SQL
					rowsPpsInserted += stmt.executeUpdate(sql);
			  }	
			  conn.close();	

		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}