public synchronized static int insert(int productID, int quantity, double discount, Date orderItemDate, Date shippingDate, boolean delivered) throws SQLException
	{
		Connection connection = null;
		PreparedStatement  prepStmt = null;

		try 
		{
	    	connection = DB.getConnection();
	    	connection.setAutoCommit(true);

	    	int insertedID = -1;

	    	String sql = "INSERT INTO OrderItem (ProductID, Quantity, Discount, OrderDate, ShippingDate, Delivered) VALUES (?,?,?,?,?,?);";
	    	prepStmt = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);

	    	prepStmt.setInt(1, productID);
	    	prepStmt.setInt(2, quantity);
	    	prepStmt.setDouble(3, discount);
	    	prepStmt.setDate(4, orderItemDate);
	    	prepStmt.setDate(5, shippingDate);
	    	prepStmt.setBoolean(6, delivered);

	    	prepStmt.executeUpdate();

	    	ResultSet rs = prepStmt.getGeneratedKeys();
	    	if (rs.next()){
	    		insertedID = rs.getInt(1);
	    	}

			prepStmt.close();
			DB.closeConnection();
			return insertedID;
		}
		catch(Exception e)
		{
			throw e;
		}
	}